[cups.general] Colors in PostScript

Jerome Alet alet at librelogiciel.com
Sat Nov 5 11:57:16 PST 2005


On Sat, Nov 05, 2005 at 01:17:32PM -0500, Nico wrote:
> 
> I am trying to implement a script which gives the number of colors 
> in a .ps file : I've tried to parse the file and use grep, but it 
> doesn't seem to be the best solution... I think we could do better 
> using GhostScript but I don't know really how to do. 
> 
> Has anyone tried doing this ? Is there other best practices ?

Use gs to convert the document to a multipage tiff image
(or to multiple one page image)

Use your favorite image analysis API to compute the number
of colors used, ink coverage, etc...

Looks like a 5 liner to me (depending on the language and API you 
are using). 

bye

Jerome Alet





More information about the cups mailing list