Match Photoshop PNG export

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
plapic
Posts: 4
Joined: 2017-05-18T19:47:55-07:00
Authentication code: 1151

Match Photoshop PNG export

Post by plapic »

When converting an eps to png via Photoshop the equivalent in ImageMagick has resulted in what appears to be highly saturated colours.
Here is the photoshop png Image

Here is the imagemagick png Image

What parameters would I need to tweak to match or come close to the photoshop version?
The only thing done in Photoshop is open the eps in RGB mode at 300dpi, resize the canvas and save as png with no interlace and small file size.

Currently using Version: ImageMagick 7.0.5-6 Q16 x64 2017-05-13
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Match Photoshop PNG export

Post by fmw42 »

Please post your EPS file and what version Ghostscript you are using? And your exact command line!

Code: Select all

gs --version
Note that PS will likely output Adobe RGB whereas ImageMagick will output sRGB unless there is a profile with your EPS file. Best to convert using profiles.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Match Photoshop PNG export

Post by snibgo »

This may be a CMYK profile problem. PNG can't store CMYK, so if the Ghostscript output is CMYK then IM will do a "-colorspace" conversion. I suspect you need a "-profile" conversion (as Fred says).

I also see the IM version contains spot colours. I assume these have been simply copied from the EPS. But IM doesn't process spot colours.
snibgo's IM pages: im.snibgo.com
plapic
Posts: 4
Joined: 2017-05-18T19:47:55-07:00
Authentication code: 1151

Re: Match Photoshop PNG export

Post by plapic »

I am using Ghostscript 9.21 64bit

Command I use is
magick convert -density 300 -antialias -gravity center -extent 827x461 -interlace none test.eps -quality 100 -auto-level png24:test.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Match Photoshop PNG export

Post by fmw42 »

Running the following in IM 6.9.8.6 Q16 Mac OSX, I get something similar to your ImageMagick result and not the PS result. I think the issue is the spot colors that Photoshop can use and ImageMagick cannot.

Code: Select all

convert -density 300 -profile /Users/fred/images/profiles/AdobeRGB1998.icc test.eps -shave 10x10 -trim +repage test.png
plapic
Posts: 4
Joined: 2017-05-18T19:47:55-07:00
Authentication code: 1151

Re: Match Photoshop PNG export

Post by plapic »

I have tried this approach with a slight improvement in the result.

magick convert test.png -profile "sRGB IEC61966-21.icc" -profile "C:\Program Files (x86)\Common Files\Adobe\Color\Profiles\Photoshop5DefaultCMYK.icc" test.png

Though I'm not quiet sure why I have to add multiple profiles to get this to change.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Match Photoshop PNG export

Post by fmw42 »

You need to add multiple profiles since the input EPS file was CMYK without a profile. It was my mistake to have missed that when examining your file. But you have the two profiles reversed. You need to specify the CMYK profile first, then the sRGB profile is last since you must convert to sRGB, since PNG does not support CMYK. I usually use USWebCoatedSWOP.icc for the CMYK profile.

This seems to be a bit better than I had before.

Code: Select all

convert -density 300 -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/AdobeRGB1998.icc test.eps -shave 10x10 -trim +repage test.png
You can try different CMYK and RGB profiles (such as sRGB).
plapic
Posts: 4
Joined: 2017-05-18T19:47:55-07:00
Authentication code: 1151

Re: Match Photoshop PNG export

Post by plapic »

When I swap the profiles around as you suggested it reverts back to the original look as if no profiles were added.
I tried your example too and still the same. I'm stumped.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Match Photoshop PNG export

Post by fmw42 »

Don't use "magick convert". Use only "magick". Does that help?

This is what I get. It looks sort of close to your PS result. I am using IM 6.9.8.6 Q16 Mac OSX with GS 9.21

Code: Select all

convert -density 300 test.eps -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/sRGB.icc -shave 10x10 -trim +repage test_result1.png
Image

and from IM 7.0.5.7 Q16 Mac OSX

Code: Select all

magick -density 300 test.eps -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/sRGB.icc -shave 10x10 -trim +repage test_result3.png
Image
Post Reply