Page 1 of 1

convert -sepia-tone different on win vs. linux

Posted: 2012-10-12T02:31:21-07:00
by creion
Hi,

I have an issue with the 2 images below: the first one is created on Linux , the second one on Windows using the same command , same versions of ImageMagick (6.6.5-0) Tried newer versions of IM and they all seem to provide different results Windows vs. Linux.

convert c.jpg -sepia-tone 80% 1.jpg (on Linux)
convert c.jpg -sepia-tone 80% 2.jpg (on Windows)

the results are very different and i cannot figure out why.

What am i doing wrong?
Thanks

Image
Image

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-12T09:31:24-07:00
by fmw42
I am not sure about your current IM version, but for versions after 6.7.8.3 all grayscale images are treated as linear rather than sRGB. This means that they will look darker than normal. So you may need to convert from RGB to sRGB before processing your grayscale image.

see
viewtopic.php?f=4&t=21269

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-13T08:45:57-07:00
by henrywho
what about

convert c.jpg -set colorspace sRGB -sepia-tone 80% 1.jpg
convert c.jpg -set colorspace sRGB -sepia-tone 80% 2.jpg

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-13T10:01:03-07:00
by fmw42
Perhaps it is best if you post a link to your original image so others can test with it. I presume it is a grayscale image.

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-15T01:17:32-07:00
by creion
The original image is not greyscale. See here Image

Doing convert c.jpg -set colorspace sRGB -sepia-tone 80% 3.jpg gives yet another bad result. Image

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-15T11:04:21-07:00
by fmw42
My guess is that -sepia-tone is expecting or converting a color image into grayscale before applying the sepia-tone. From IM 6.7.5.5 (or 6.7.6.7) colorspace RGB and sRGB were swapped (to make them correct). Furthermore after IM 6.7.8.3 grayscale images were considered linear. Thus in IM 6.8.0.0, this works for me. Your input is true sRGB, but the conversion by sepiatone makes it linear grayscale. Thus one needs to tell it to think the image is linear even though sRGB, (that is make it think it is RGB). So this works to reproduce your Linux results on my Mac OSX Snow Leopard, IM 6.8.0.0 Q16

convert c.jpg -set colorspace RGB -sepia-tone 80% c2.jpg

I suspect you have mixed versions of IM and are getting different results due to the changes that took place over some time in IM. I would suggest you upgrade to something after IM 6.7.8.3.

The darker of your two result could be that IM is converting it to linear and that would make it darker. You could try on your Windows, the suggestion by henrywho

convert c.jpg -set colorspace sRGB -sepia-tone 80% c2.jpg

since the earlier versions were treating RGB as sRGB and sRGB as RGB, so the above would try to make the grayscale version be treated (not converted) as a proper linear RGB

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-15T19:12:57-07:00
by anthony
First check versions of Imagemagick on the two machines... (most likely cause).

Second check versions of the JPEG library!

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-16T04:22:28-07:00
by creion
Hey guys,
Thanks so much for your input. It turns out i had to do

Code: Select all

convert c.jpg -set colorspace RGB -sepia-tone 80% 1.jpg
So basically forcing Windows to convert it to RGB.

The sRGB conversation was close but it actually had to be RGB.

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-16T10:31:36-07:00
by fmw42
creion wrote:Hey guys,
Thanks so much for your input. It turns out i had to do

Code: Select all

convert c.jpg -set colorspace RGB -sepia-tone 80% 1.jpg
So basically forcing Windows to convert it to RGB.

The sRGB conversation was close but it actually had to be RGB.

That would be correct if you IM version was greater than 6.7.6.7 (or more likely 6.7.8.3). But you claim it is 6.6.5.0. So that is strange to me. Are you sure of your IM versions and that you don't have multiple versions.

Re: convert -sepia-tone different on win vs. linux

Posted: 2012-10-17T05:23:30-07:00
by creion
I checked a few times. And on Windows i actually copied convert.exe from the standalone win version of IM to a new folder and did -version first and then ran the command in command prompt and it worked. Version is indeed 6.6.5.0.
fmw42 wrote:
creion wrote:Hey guys,
Thanks so much for your input. It turns out i had to do

Code: Select all

convert c.jpg -set colorspace RGB -sepia-tone 80% 1.jpg
So basically forcing Windows to convert it to RGB.

The sRGB conversation was close but it actually had to be RGB.

That would be correct if you IM version was greater than 6.7.6.7 (or more likely 6.7.8.3). But you claim it is 6.6.5.0. So that is strange to me. Are you sure of your IM versions and that you don't have multiple versions.