Page 1 of 1
Converting to -colorspace gray changes color values?
Posted: 2017-06-07T12:21:37-07:00
by i73
When exporting from Photoshop grayscale png-8 it still contains color data, in order for me to get 'true grayscale' I have to run:
Code: Select all
$"{ myImagepath } -set colorspace RGB -colorspace gray { myImagepath }"
my problem is it changes the actual color data / color pallet, when IM runs on the photoshops export; as you can see from my test:
Export from Photoshop:
Photoshop Export ran in Image Magic:
Original image:
What can I do to solve this?
Re: Converting to -colorspace gray changes color values?
Posted: 2017-06-07T12:26:15-07:00
by snibgo
What version IM are you using? If fairly recent (since about v6.7.5), don't put "-set colorspace RGB". That says the image is linear RGB, which it probably isn't.
Re: Converting to -colorspace gray changes color values?
Posted: 2017-06-07T13:23:09-07:00
by i73
snibgo wrote: ↑2017-06-07T12:26:15-07:00
What version IM are you using? If fairly recent (since about v6.7.5), don't put "-set colorspace RGB". That says the image is linear RGB, which it probably isn't.
Using: Magic.net 6.8.7
Removing colorcolorspace fixed it a little but I am still getting a little bit lighter of a image, do I just have to live with it?
Thanks for the reply!
Re: Converting to -colorspace gray changes color values?
Posted: 2017-06-07T13:27:05-07:00
by fmw42
How much lighter? Can you show us pictures? Photoshop may be outputting a grayscale profile or may be using dot gain, that ImageMagick does not use.
Re: Converting to -colorspace gray changes color values?
Posted: 2017-06-07T13:49:07-07:00
by i73
No problem, can I output with dotgain?
I know these images look almost identical but when you toggle through them in Photoshop you can notice the difference. It's not a huge deal at this point but just wondering if I can get the identical output.
Photoshop output:
The Image magic output:
Side by side you can see the diff, it's slight but it's still there:
Re: Converting to -colorspace gray changes color values?
Posted: 2017-06-07T15:04:39-07:00
by snibgo
Those images look the same to me. According to IM, they are identical.
Re: Converting to -colorspace gray changes color values?
Posted: 2017-06-07T16:07:43-07:00
by fmw42
There are two difference that I see in the meta data (from identify -verbose).
Your photoshop image is gray, but its colorspace is sRGB, while the IM version is gray with colorspace Gray. I doubt this has an affect.
But the photoshop image has rendering intent of perceptual and the IM version has rendering intent of Undefined. That might make a difference when viewing.
As user snibgo says, the data itself is identical.
Try adding -intent perceptual to your ImageMagick command and see if that helps. Check the identify -verbose data to be sure it is rendering intent of perceptual.
Re: Converting to -colorspace gray changes color values?
Posted: 2017-06-07T16:28:58-07:00
by i73
Thanks guys, yeah they are pretty much identical, literally the smallest differences.
Re: Converting to -colorspace gray changes color values?
Posted: 2017-06-07T19:30:15-07:00
by fmw42
If you do as snibgo said:
Code: Select all
compare -metric rmse photoshop.png imagemagick.png null:
0 (0)
Means that they are identical in pixel data.
But as I said above, you have two different rending intents. That causes differences when displaying for viewing. So add -intent perceptual to your IM command. See
http://www.imagemagick.org/script/comma ... php#intent. You may need to add the same profile to both results to be sure that PS is not using Adobe RGB and ImageMagick using sRGB.