Best way to produce 'colour correct' raster from a PDF or PS with ghostscript

故事扮演 提交于 2019-12-11 02:47:10

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/8204629/best-way-to-produce-colour-correct-raster-from-a-pdf-or-ps-with-ghostscript

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!