Reputation: 23
What is the best way to produce colour correct raster files with ghostscript?
The various ways that ColorConversionStrategy, UseCIEColour and ICC profiles interact is not that obvious, and its quite easy to produce images that are way off in terms of colour.
So far the below command is the best that I've managed, but its still produces slightly different hues for our test files when compared against previewing in Acrobat Pro and I'm wondering if anyone has a more 'scientific' answer. Cheers!
./software/ghostscript-9.04/bin/gs -sOutputICCProfile=./profiles/sRGB.icc -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -r94 -dUseCropBox -dEPSCrop -dMaxBitmap=50000000 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dAlignToPixels=0 -dGridFitTT=0 -dPrinted=false -dLastPage=1 -sDEVICE=jpeg -sOutputFile=/dev/stdout imm.pdf > imm.jpg
Upvotes: 2
Views: 1235
Reputation: 31199
What simulation profile are you using as a comparison in Acrobat ?
You must use the same profile in both Acrobat and Ghostscript if you expect to see the same result, and even then there may well be subtle differences, since the two use different colour engines. These probably won't be visually detectable on-screen though.
The methods you mention don't really interact at all.
ColorConversionStrategy is only relevant to the pdfwrite device, when producing PDF files, so nothing to do with rendering at all. It does not 'interact' with the others in any meaningful way.
UseCIEColor is an old and rather ill-used PostScript paradigm for colour management, it relies upon you supplying Color Rendering Dictionaries (CRDs) which describe the colour properties of your device. If you use the defaults then you will get something acceptable, but it won't be 'right'. CRDs are somewhat analogous to ICC Profiles, but they are not exactly the same.
ICC profiles are the way to go.
If you are using ICC profiles don't set UseCIEColor. In fact don't set UseCIEColor if you expect to get good colour unless you know exactly what you are doing with it.
Upvotes: 4