We from jQueryUI use ImageMagick to generate the themeRoller custom icons and textures. Trying to upgrade IM on our server, we noticed a unwanted behavior. Perhaps we are misusing IM, and it may not be a bug. Follow the problematic use case.
We generate custom color icons as follows:
`convert icons-mask.png -background <color> -alpha shape output.png`
Picking any non-fully-saturated-color, let's say #DDAA00, we get different output using 6.8.* [1] vs. 6.6.* [2]. Point your browser to each output and you'll see 6.8.* shows a different color than the specified in <color>. (side note: actually, opening `output.png` on a graphic editor tool like GIMP, the color displays just fine. The browsers do not)
1 6.8: https://f.cloud.github.com/assets/96715 ... 5c9410.png
2 6.6: https://f.cloud.github.com/assets/96715 ... 6ff8e1.png
Are we misusing it? Any advice? Is it a regression?
More info at: https://github.com/jquery/download.jque ... issues/110
6.8.3-9 Color generated by -alpha shape differs
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: 6.8.3-9 Color generated by -alpha shape differs
I've never used "-alpha shape", but some experimentation shows the behaviour has changed with the RGB/sRGB issue. See many threads related to this. In a nutshell: current IM versions convert from sRGB to RGB before calculating the grey values. Old versions (prior to about v6.7.9) didn't do this. To prevent this conversion, tell IM the image is already in RGB colourspace:
Code: Select all
convert icons-mask.png -set colorspace RGB -background <color> -alpha shape output.png
snibgo's IM pages: im.snibgo.com
Re: 6.8.3-9 Color generated by -alpha shape differs
Hi snibgo, thanks for the suggestion. But, it didn't work. As you can see we still have the wrong output:
https://f.cloud.github.com/assets/96715 ... 2f75ee.png
https://github.com/jquery/download.jque ... t-15297562
https://f.cloud.github.com/assets/96715 ... 2f75ee.png
https://github.com/jquery/download.jque ... t-15297562
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: 6.8.3-9 Color generated by -alpha shape differs
Your reference https://f.cloud.github.com/assets/96715 ... 2f75ee.png seems to be your output file. Can you supply your input file?
snibgo's IM pages: im.snibgo.com
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: 6.8.3-9 Color generated by -alpha shape differs
Okay, with a bit more time, I think your input image is https://f.cloud.github.com/assets/96715 ... 94572d.png Correct? This is greyscale, and almost all the pixels are either black or white. The RGB/sRGB issue will make almost no difference, because black <=> black and white <=> white across the colorspaces.
However, it's a good idea, when using "-set colorspace RGB", to follow that with "-set colorspace sRGB" before the output file. This seems to ensure the sRGB PNG chunk is written. Maybe the absence of this has been confusing some of your browsers.
Aside from that point, all combinations of IM versions I have tried, with and without either "-set colorspace", result in the same pixel values written: every pixel is #DDAA00, but alpha varies between pixels.
However, it's a good idea, when using "-set colorspace RGB", to follow that with "-set colorspace sRGB" before the output file. This seems to ensure the sRGB PNG chunk is written. Maybe the absence of this has been confusing some of your browsers.
Code: Select all
convert input_mask.png -background #DDAA00 -set colorspace RGB -alpha shape -set colorspace sRGB output.png
snibgo's IM pages: im.snibgo.com
Re: 6.8.3-9 Color generated by -alpha shape differs
snibgo, it worked just fine now with the "-set colorspace sRGB" before the output file.
Thanks for your help!!
Thanks for your help!!