EPS to JPG Darkens Image

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
pjvedder
Posts: 12
Joined: 2011-06-22T12:39:02-07:00
Authentication code: 8675308

EPS to JPG Darkens Image

Post by pjvedder »

For some reason when I try to convert an eps to a jpg, it's darkening the image as a result. This doesn't happen every time, but has happened to multiple images. I'm not sure if it has anything to do with the fact that the resolution is 457. The image was uploaded by a client, and I need to be able to convert the file to jpg as-is. I also noticed that if i were to re-save the file in photoshop, without changing anything, it will give me an image result that is perfect. I can't rely on Photoshop to save the file each time, however, and need to solve this using only IM.

Here is the command line I'm using:
convert Sample.eps Sample.jpg

Here's the original EPS
http://dl.dropbox.com/u/14916695/Sample.eps

And the darkened result:
http://dl.dropbox.com/u/14916695/Sample.jpg

I'm using ImageMagick 6.7.0-8 Q16 and GhostScript 9.02

Any help would be greatly appreciated... thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EPS to JPG Darkens Image

Post by fmw42 »

Your image is cmyk format and not rgb. Furthermore it has a Photoshop Adobe RGB profile that apparently IM does not recognize or handle properly. I tried many combinations of -colorspace rgb and -profiles, but none made it look lighter as in the original. Perhaps someone with more experience with profiles can be of more help.

I tried the following using -density 72 to get a quick and smaller version. (IM 6.7.0.8 Q16 Mac OSX Tiger)

convert -colorspace RGB -density 72 Sample.eps Sample.jpg

convert -density 72 Sample.eps -profile Profiles/AdobeRGB1998.icc Sample_rgb.jpg

convert -density 72 Sample.eps -profile Profiles/USWebCoatedSWOP.icc -profile Profiles/AdobeRGB1998.icc Sample_cmyk_rgb.jpg

convert -density 72 Sample.eps -strip -profile Profiles/USWebCoatedSWOP.icc -profile Profiles/AdobeRGB1998.icc Sample_cmyk_rgb.jpg


identify verbose Sample.eps

Sample.eps
Image: Sample.eps
Format: EPT (Encapsulated PostScript with TIFF preview)
Class: DirectClass
Geometry: 3085x4113+0+0
Base geometry: 3087x4113
Resolution: 457x457
Print size: 6.75055x9
Units: PixelsPerInch
Type: ColorSeparation
Base type: ColorSeparation
Endianess: Undefined
Colorspace: CMYK
Depth: 16/8-bit
...

Properties:
date:create: 2011-06-22T13:53:20-07:00
date:modify: 2011-06-22T13:53:20-07:00
dc:format: image/epsf
exif:ColorSpace: -1
exif:DateTimeDigitized: 2007-01-25T11:40:11-05:00
exif:DateTimeOriginal: 2007-01-25T11:40:11-05:00
exif:ExifVersion: 0.2.2.0
exif:NativeDigest: 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;D965EC7BE15A8F11484C46E340E8DF42
exif:PixelXDimension: 3087
exif:PixelYDimension: 4113
photoshop:ColorMode: 4
photoshop:History:
photoshop:ICCProfile: Adobe RGB (1998)
ps:HiResBoundingBox: 486x648+0+0
ps:Level: Adobe-3.0 EPSF-3.0
signature: 61d39d9266b45bfaf0c22ed8f339f723eacd94db7944720bb5dbfcb1e57a122b
stRef:documentID: uuid:40A2647FCFAB11DB8ED6F63C55D12E8E
stRef:instanceID: uuid:40A26480CFAB11DB8ED6F63C55D12E8E
tiff:Compression: 1
tiff:ImageLength: 5436
tiff:ImageWidth: 4080
tiff:Make: Phase One
tiff:Model: P 25
...
Last edited by fmw42 on 2011-06-23T12:59:50-07:00, edited 1 time in total.
pjvedder
Posts: 12
Joined: 2011-06-22T12:39:02-07:00
Authentication code: 8675308

Re: EPS to JPG Darkens Image

Post by pjvedder »

Thanks for taking a look at this. I'm thinking that this image was made with a VERY old version of Photoshop and that's why it's using that weird profile (it looks like it's original creation date was from 2007), and hoping that going forward, any new image that I come across that is uploaded to me won't have this problem. But in the off chance that this isn't the case, I can't really write my script to have a one-off removal of this profile or any image-specific actions, since the code has to apply to every image that is uploaded by my users. Does anyone know of any other "catch-all" solution?
Post Reply