Gradient issue in EPS to JPG conversion

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
deepeshsp
Posts: 6
Joined: 2013-07-25T23:55:41-07:00
Authentication code: 6789

Gradient issue in EPS to JPG conversion

Post by deepeshsp »

When I convert an image, I am getting bars for gradient effect. This happens only when I specify colorspace as sRGB

i have attached the files here
eps : https://app.box.com/s/hqsscfy1dbkcvblih4ps
JPG: https://app.box.com/s/5zjqy56cywtlbqqqdbi9

In eps, there is a gradient effect of light under the text. But when i convert it to jpg, the gradient is not looking proper.

what i did is

Code: Select all

convert.exe -colorspace srgb -density 494 "2 (2).eps" "2 (2).eps.jpg"
P.S. please dont check the file online. Please download it. The app.box.com will convert the eps to jpg, which is not proper.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Gradient issue in EPS to JPG conversion

Post by snibgo »

The "-colorspace sRGB" conversion should come after reading the input, not before it.

Code: Select all

convert -density 494 "2 (2).eps" -colorspace sRGB x.jpg
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: Gradient issue in EPS to JPG conversion

Post by fmw42 »

convert.exe -colorspace srgb -density 494 "2 (2).eps" "2 (2).eps.jpg"
This is valid. The -colorspace and -density need to come before any vector file such as eps. But using -colorspace sRGB is not very accurate. You should use profiles. This seems to work better for me on my Mac. I renamed to file to avoid the spaces for simplicity.


convert -density 494 2.eps -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/sRGB.icc 2eps_rgb.jpg

The first profile is CMYK. The second is sRGB. So we are converting CMYK eps to sRGB and saving as jpg.
deepeshsp
Posts: 6
Joined: 2013-07-25T23:55:41-07:00
Authentication code: 6789

Re: Gradient issue in EPS to JPG conversion

Post by deepeshsp »

Thanks for the wonderful solution.
Applying color formats minimises (not completely removed) the gradient issues, but then the generated jpg has slight color variations from the eps file.
This color difference is not there when -colorspace sSRGB is used.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Gradient issue in EPS to JPG conversion

Post by fmw42 »

Sorry I only know 2 methods. The first you properly used by adding -colorspace sRGB (before reading the eps file) and the other is using profiles
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Gradient issue in EPS to JPG conversion

Post by snibgo »

Some profile other than USWebCoatedSWOP.icc may be more accurate.

The image includes Photoshop spot colours, which IM will ignore.
snibgo's IM pages: im.snibgo.com
Post Reply