diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 6286bc83e6..9eb46d32f7 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -424,8 +424,9 @@ void PDF_PLOTTER::PlotImage( const wxImage & aImage, const wxPoint& aPos, } else { - // Grayscale conversion - putc( (r + g + b) / 3, workFile ); + // Greyscale conversion (CIE 1931) + unsigned char grey = KiROUND( r * 0.2126 + g * 0.7152 + b * 0.0722 ); + putc( grey, workFile ); } } } diff --git a/common/plotters/PS_plotter.cpp b/common/plotters/PS_plotter.cpp index 7b2425814d..52353577a4 100644 --- a/common/plotters/PS_plotter.cpp +++ b/common/plotters/PS_plotter.cpp @@ -737,7 +737,12 @@ void PS_PLOTTER::PlotImage( const wxImage & aImage, const wxPoint& aPos, if( colorMode ) fprintf( outputFile, "%2.2X%2.2X%2.2X", red, green, blue ); else - fprintf( outputFile, "%2.2X", (red + green + blue) / 3 ); + { + // Greyscale conversion (CIE 1931) + unsigned char grey = KiROUND( red * 0.2126 + green * 0.7152 + blue * 0.0722 ); + + fprintf( outputFile, "%2.2X", grey ); + } } }