Page 1 of 1

Greyscale XCF files come out green

Posted: 2014-06-07T11:55:28-07:00
by bawolff
Greyscale XCF images appear to be treated as RGB images with green channel fully on, and the other two channels being the greyscale image.

Steps to reproduce:

* Get a greyscale xcf file (I'm using https://upload.wikimedia.org/wikipedia/ ... C_1914.xcf )
* try the command

Code: Select all

convert Romain_Rolland_de_face_au_balcon,_Meurisse,_1914.xcf -thumbnail 438x600\! -layers merge out.png
Expected output: A shrunk down png version of the greyscale image
Actual output: The image in various shade of green.

Bug is also observable by doing

Code: Select all

display Romain_Rolland_de_face_au_balcon,_Meurisse,_1914.xcf
For reference:

Code: Select all

bawolff@Bawolff-L:~$ convert --version
Version: ImageMagick 6.8.9-2 Q16 i686 2014-06-07 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fftw fontconfig freetype jbig jng jpeg lzma pangocairo png tiff x xml zlib

bawolff@Bawolff-L:~$ uname -a
Linux Bawolff-L 3.2.0-4-686-pae #1 SMP Debian 3.2.41-2 i686 GNU/Linux

I've been able to work around this issue by using command line arguments -colorspace sRGB -channel R -separate, but given its a greyscale image, one shouldn't have to do things like that.

I believe you can tell if an xcf file is grey scale by looking at the 25th byte of the file. If it's 0x00 it's RGB, 0x01 is greyscale, and 0x02 is indexed colour.

Downstream bug report: https://bugzilla.wikimedia.org/show_bug.cgi?id=66323

Thanks,
--bawolff

Re: Greyscale XCF files come out green

Posted: 2014-06-07T12:38:41-07:00
by fmw42
I can confirm this issue.

If I separate channels on this image, it shows that the green channel has become pure white. I think this is the root of the issue in the IM xcf reader.

I am using IM 6.8.9.2 Q16 Mac OSX.

Re: Greyscale XCF files come out green

Posted: 2014-06-07T13:29:18-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-3 Beta, available by sometime tomorrow. Thanks.