c933103 said:
It seems like, when an illustration is created with color spaces that are not sRGB, the thumbnailing algorithm cannot properly handle such image.
An example can be seen in post #2970342 which was created using the ProPhoto RGB color space, you see the text is colored in one color, but once you click the "view original" button, the text would become another color, as long as you are not using IE6 or some phone browsers. The color appear in original mode is correctly displayed by most browser while the thumbnailed image display the wrong color. The same problem probably will also occur when a CMYK or Adobe RGB colored image get uploaded.
Danbooru’s sample and thumbnail generation code strips all color profiles from the output files to save space.
danbooru_image_resizer.rb line 18:
image.strip!
strip! documentation
The solution would be to unconditionally convert to sRGB before stripping. This works even if the input file has no profile because sRGB is assumed in that case anyway. With command line ImageMagick, this does the trick (if you have GhostScript installed):
convert input.png -resize 850x -profile /usr/share/color/icc/ghostscript/srgb.icc -strip sample.jpg
Unfortunately, I don’t know how to do that with RMagic in Ruby. Maybe one of our Ruby wizards can figure it out?
I’ll go open an issue for it.
c933103 said:
"You cannot upload during your first week of registration"
Hum ok. It'll probably be many weeks before I have some other things that would like to test
Danbooru uses ImageMagic (well, RMagick), so I suggest you install ImageMagick and play around with it locally to figure things out first.
Also, I noticed that you created your test image with Gimp. Interestingly, the color profile contained in your test PNG seems to be ignored when I load the file in Gimp. The colors I see are exactly the same as in the incorrectly generated sample (more olive/brown). The image also looks exactly the same in any other image viewer I tried (ImageMagick’s display
, Eye of Gnome, MComix). Only Firefox displays the correct(?) more orange color.
Edit: Opened issue #3476.