Colour changes when converting from EPS to PNG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
SCHOLARGraeme
Posts: 2
Joined: 2014-03-20T11:07:45-07:00
Authentication code: 6789

Colour changes when converting from EPS to PNG

Post by SCHOLARGraeme »

Hi,

I am using the following command to convert an EPS image to a 24-bit PNG:

Code: Select all

convert Colours.eps PNG24:Colours.png
As you can see from the image below it doesn't replicate the colours exactly, with the original EPS appearing on the left and the ImageMagick conversion on the right:
Image

The original EPS file can be downloaded here:
https://www.dropbox.com/s/p2r2zdow1lqb4fw/Colours.eps

Any idea if I am using ImageMagick wrong or if this is a bug?

I am using ImageMagick 6.8.8-9 Q16 x64 2014-03-16 on Windows 7

Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colour changes when converting from EPS to PNG

Post by fmw42 »

Your image is cmyk EPS (according to identify -verbose Colours.eps) and needs to be converted to sRGB. PNG does not support cmyk. It also results in missing colors that seem to be represented as transparency (see snibgo's comments below), so you may want to flatten against a white background. You may also want to set the density before reading the eps so that the output will be the desired resolution. I do not see much difference using profiles vs -colorspace.

Code: Select all

convert [-density XX] -colorspace sRGB Colours.eps PNG32:Colours1.png

Code: Select all

convert [-density XX] -colorspace sRGB Colours.eps -background white -flatten Colours2.png

Code: Select all

convert [-density XX] Colours.eps -profile /Users/fred/images/Profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/Profiles/sRGB.icc -background white -flatten Colours3.png
Brackets on -density just mean that is optional
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Colour changes when converting from EPS to PNG

Post by snibgo »

The missing colours are probably the Photoshop spotcolors that can be seen in "identify -verbose colours.eps". These are colours that use special inks that may not be reproducible with RGB or CMYK.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colour changes when converting from EPS to PNG

Post by fmw42 »

snibgo wrote:The missing colours are probably the Photoshop spotcolors that can be seen in "identify -verbose colours.eps". These are colours that use special inks that may not be reproducible with RGB or CMYK.
You are right. I missed that. The transparency may be coming from those missing spot colors. Odd that IM would use transparency for that. No actual transparency shows in the verbose info. That is, the file is CMYK and not CMYKA.
SCHOLARGraeme
Posts: 2
Joined: 2014-03-20T11:07:45-07:00
Authentication code: 6789

Re: Colour changes when converting from EPS to PNG

Post by SCHOLARGraeme »

Thank you fmw42 and snibgo and for the information about those spot colours.

The following command gets the conversion I am looking for:

Code: Select all

convert [-density XX] -colorspace sRGB Colours.eps PNG32:Colours1.png
Thank again.
Post Reply