I'm using the Ghostscript API from c#, to convert multipage PDF's to jpgs.
My issue is with colour conversion.
When I open the Source PDF in photoshop, and export to jpeg, each colour in each jpeg matches the colours of the original PDF perfectly.
However, when I run the process through Ghostscript, the colour come out as different shades than the original. eg:
Original PDF colour: #8DBB3F;
Photoshop pdf to jpg colour: #8DBB3F;
Ghostscript pdf2jpg colour: #7DEE00;
This happens with all colours - all slightly to massively different shades.
These are the arguements passed to ghostscipt:
"pdf2jpg -dNOPAUSE -dBATCH -dSAFER -sDEVICE=jpeg -r150 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dMaxStripSize=8192 -sOutputFile=myfile-%d.jpg
Can anyone help?
-dUseCIEColor (as sovo said) plus try adding
-dJPEGQ=95 to set JPEG quality to 95%.
Also, you may want to try
-sDEVICE=jpegcmyk to make the JPEG use the CMYK color space.
-sDEVICE=jpeg uses RGB colors. If your PDF had used CMYK, conversion to RGB will probably cause more color deviations, especially in the absence of ICC profile usage.)
-dUseCIEColor worked for me, BUT then I tried using an updated DLL version, and that solved the issue without passing in the new flag, and it also resolved my font rendering issue with an embedded font. I replaced by older DLL with the version 9.16. I also was able to leave my jpeg quality at 100.
Try DPI parameter value 300+ (-r300) in ghostscript