How to get exact color values from EPS files...

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
ananthakumarj
Posts: 2
Joined: 2015-07-28T23:16:28-07:00
Authentication code: 1151

How to get exact color values from EPS files...

Post by ananthakumarj »

Hi All,

This is my first post in this forum.

How can i get the color information (CMYK, RGB, Black & White) from EPS image file. I am not added any xmp or meta information in image file. Is this possible to get these details in "perl" or "IM".

Thanks in Advance..

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

Re: How to get exact color values from EPS files...

Post by fmw42 »

see %[colorspace] at http://www.imagemagick.org/script/escape.php

Code: Select all

convert image.eps -format "%{colorspace]" info:
or just extract it from

Code: Select all

identify -verbose image.eps
ananthakumarj
Posts: 2
Joined: 2015-07-28T23:16:28-07:00
Authentication code: 1151

Re: How to get exact color values from EPS files...

Post by ananthakumarj »

Hi Thanks for reply,

I am used this commands,
"identify -verbose image_cmyk.eps"
"identify -verbose image_rgb.eps" but in both outputs, "Colorspace" provides the value "CMYK".

Image files are created in Adobe Illustrator.

Regards,
Kumar J
246246
Posts: 190
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: How to get exact color values from EPS files...

Post by 246246 »

ananthakumarj wrote:Hi Thanks for reply,

I am used this commands,
"identify -verbose image_cmyk.eps"
"identify -verbose image_rgb.eps" but in both outputs, "Colorspace" provides the value "CMYK".

Image files are created in Adobe Illustrator.
I think ImageMagick only read the %%DocumentProcessColors: comment on the head of EPS file to determine colorspace.

I guess your image_rgb.eps has

%%DocumentProcessColors: Cyan Magenta Yellow Black

line on the head of the document. See also https://forums.adobe.com/thread/812746?tstart=0

So I think the real question is whether your file is properly converted to RGB.
If it is your concern, to ask adobe is better, however, if you upload your file, someone here could investigate.
(As I am not using Illustrator, and it might also depends its version, I cannot help more. Quick google search leads me the following: http://blog.brandisty.com/here-s-how-to ... lustrator/ )

In general case, EPS can contain both RGB & CMYK object at the same time. For example, I believe the following is valid EPS.

Code: Select all

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 500 300
%%Extensions: CMYK
%%LanguageLevel: 2
%%Pages: 0
%%EndComments
newpath
300 100 moveto 
100 0 rlineto
0 100 rlineto
-100 0 rlineto
closepath
gsave
1 .7 0 0 setcmykcolor
fill
grestore
0 .3 1 0 setcmykcolor
10 setlinewidth
stroke

newpath
100 100 moveto 
100 0 rlineto
0 100 rlineto
-100 0 rlineto
closepath
gsave
1 1 .5 setrgbcolor
fill
grestore
.5 1 0 setrgbcolor
10 setlinewidth
stroke

%%EOF
So no one can determine whether EPS file is RGB or CMYK. ImageMagick treat it as RGB and handle this with gs "-sDEVICE=pngalpha" accoding to delegate.xml settings.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to get exact color values from EPS files...

Post by fmw42 »

Are you converting the CMYK eps to RGB? Or do you have two totally different and unrelated eps files? A proper conversion of the CMYK file to sRGB should report sRGB by IM, I would think. If you are converting, the post your command line for doing that.
Post Reply