Page 1 of 1

Only 2 layers from Gimp XCF

Posted: 2010-06-23T06:10:32-07:00
by snibgo
IM can only see the bottom two layers from a Gimp XCF file.

For example, I have created http://www.snibgo.org/images/gimplayers.xcf in Gimp 2.6.8. A screenshot of Gimp looks like this:

Image

identify gimplayers.xcf

gimplayers.xcf[0] XCF 320x200 320x200+0+0 8-bit DirectClass 21.5KB 0.016u 0:00.016
gimplayers.xcf[1] XCF 320x200 320x200+0+0 8-bit DirectClass 0.016u 0:00.016

"Convert" is consistent with 2-layers-only:

convert gimplayers.xcf -layers flatten glflat.png

Image

This is on Windows7, IM 6.6.2-4. Earlier versions of IM show the same behaviour.

Re: Only 2 layers from Gimp XCF

Posted: 2010-06-23T06:18:32-07:00
by magick
It may be some time before we fix the XCF problem. We currently do not have a maintainer for the XCF image format.

Re: Only 2 layers from Gimp XCF

Posted: 2011-06-06T14:48:45-07:00
by GoblinWorkshopGames
I'm confirming the same issue. I'm not sure if xcfinfo or xcf2png will work better, since I'm a noob and still trying to get GIMP installed on my VPS. :) One problem at a time, I suppose...

Anthony Gill

Re: Only 2 layers from Gimp XCF

Posted: 2011-07-23T11:35:15-07:00
by efAston
Yes I've had the same problem. It's a shame, because I've been using GIMP to modify PDF's, and to convert the modified documents back to PDF, I first need to output all the layers to separate images (which requires a plugin).

http://kubuntuforums.net/forums/index.php?topic=3117706

I tried saving files to PSD to see if that solved the problem, what happened was I got a PDF which had one page for each layer (correct), except the bottom layer was repeated as a final page in the PDF (so a four layer PSD is output to a PDF which reads Page 1, Page 2, Page 3, Page 4, Page 1).

It did however, work perfectly when I saved to an animated GIF and converted from that :D. Of course GIF has colour restrictions, but saving to MNG solves that problem. That actually solves my issue.

Re: Only 2 layers from Gimp XCF

Posted: 2011-07-23T11:55:47-07:00
by fmw42
In GIMP, save your files as psd. That seems to be the only one of the GIMP export formats that will handle both transparency and layers. (GIMP is kind of "gimpy" with respect to dealing with transparency and layers in saving to other output formats). Then IM can process that, though you will get an extra first [0] layer that is the flattened image, but the remaining four layers are there after that, with respect to the first example provided by snibgo.

Re: Only 2 layers from Gimp XCF

Posted: 2011-07-23T12:04:43-07:00
by efAston
That would be cool if you could exclude layer 0 with a switch, as having that in the mix is enough of a hassle to add an extra step.

Re: Only 2 layers from Gimp XCF

Posted: 2011-07-23T12:10:18-07:00
by fmw42
IM can filter out any layers you want. For example, in GIMP, first save your files as psd, then

convert gimplayers.psd[1-4] gimplayers1to4.psd

convert gimplayers1to4.psd -scene 1 gimplayers1to4_%d.png
gimplayers1to4_1.png
gimplayers1to4_2.png
gimplayers1to4_3.png
gimplayers1to4_4.png


or save it to some other format that supports both layers and transparency, such as tif, or IM's miff

convert gimplayers.psd[1-4] gimplayers1to4.tif

convert gimplayers1to4.tif -scene 1 gimplayers1to4_%d.png
gimplayers1to4_1.png
gimplayers1to4_2.png
gimplayers1to4_3.png
gimplayers1to4_4.png

see
http://www.imagemagick.org/Usage/files/#read_mods
http://www.imagemagick.org/Usage/files/#scene

Re: Only 2 layers from Gimp XCF

Posted: 2011-07-23T12:23:46-07:00
by GoblinWorkshopGames
Thanks Fred - I think this gets me unstuck! I appreciate the reply. :)

Re: Only 2 layers from Gimp XCF

Posted: 2011-07-23T17:50:11-07:00
by efAston
Yeah that's really handy information, cheers from me too :).

Re: Only 2 layers from Gimp XCF

Posted: 2011-07-23T18:04:53-07:00
by fmw42
It is too bad that GIMP does not support multilayer transparent files other than PSD, not even TIF.

Hopefully one day, some kind knowledgeable programmer will be able to contribute to helping make IM more compatible with GIMP's XCF image format.