Greyscale XCF files come out green

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
bawolff
Posts: 2
Joined: 2014-06-07T11:21:20-07:00
Authentication code: 6789

Greyscale XCF files come out green

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Greyscale XCF files come out green

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Greyscale XCF files come out green

Post 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.
Post Reply