문제

I'm trying to extract the colorspace of an EPS file using Ghostscript. I currently use ImageMagick's identify command but it must rasterize the image before it determines the colorspace. How can I do this with Ghostscript without rasterizing the image?

도움이 되었습니까?

해결책

You've already asked essentially this question here : How can I extract color values from an EPS file?

And I've answered it. EPS files do not have 'a colorspace', they contain marking operations which take place in any of a number of different colour spaces. Because PostScript is a programming language, there is no way to know for certain which colour space(s) are used without interpreting the entire program.

The technique I outlined in my previous answer allows you to 'hook' any of the PostScript marking operations and detect the colour space in force at the time (for images you will have to inspect the dictionary, since they carry the colour space with the arguments).

Your other alternative is to write a Ghostscript device, which will receive all the marking operations and can inspect the current colour space directly, but this is also a great deal of work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top