Page 1 of 1

Flatten Invisible Layers in PSD

Posted: 2011-10-26T09:58:24-07:00
by tamasei
I am trying to convert PSD files to TGA. Some of the PSD files have layers set to invisible so a straight flatten command wouldn't have those layers.

Basically doing this only yield visible layers: convert test.psd -flatten test.tga
But I need all layers in TGA file.

Is there a way to set layers to visible? or option to flatten all layers visible or not?

thanks

Re: Flatten Invisible Layers in PSD

Posted: 2011-10-26T10:01:09-07:00
by magick
ImageMagick does not currently support an option to ignore the visibility layer attribute. Post a URL to one of your PSD images with an invisible layer and we will use it to add an option to the PSD coder to ignore the visibility layer attribute.

Re: Flatten Invisible Layers in PSD

Posted: 2011-10-26T10:28:18-07:00
by tamasei
Is there a way to composite the layers into a flatten image? If I do
convert test.psd[5] test.tga
it will get the layer into the tga file.

I'm trying out command like
convert -composite test.psd[1] -composite test.psd[2] -flatten test.tga
but it never merge the layers, tga file only has layer 1's image.

Re: Flatten Invisible Layers in PSD

Posted: 2011-10-26T10:43:30-07:00
by fmw42
try

convert test.psd[1-5] -background black -flatten test.tga

or how ever many you want. Layer 0 is usually the flattened layer.

what do you get from

convert test.psd[0] test.tga

Re: Flatten Invisible Layers in PSD

Posted: 2011-10-26T12:23:23-07:00
by tamasei
convert test.psd[1-5] -background black -flatten test.tga
This gives me a file that's completely white. I suspect the white may be the white background on layer 1. But then again if I do
convert test.psd[5] -background black -flatten test.tga
it still gives me a file with full white.
Edit: I removed the white background layer and still same result so I don't know where is that white coming from.

For this
convert test.psd[0] test.tga
I got one file, test.tga. It's just black because none of the layer is set to visible.

There are 5 layers in the file, lowest layer is white background.

Re: Flatten Invisible Layers in PSD

Posted: 2011-10-26T12:54:52-07:00
by fmw42
If there are five layers in the file, the IM indices would be 0-4. So layer [5] is not really in your image.

Try looking at each of your layers

convert image.psd image.png

see what each layer looks like. PNG does not support layers so you will get image-0.png ... image-4.png if you have 5 layers that IM can detect.

can you post a link to your PSD file so others can take a look at what is in it?

Re: Flatten Invisible Layers in PSD

Posted: 2011-10-26T18:37:22-07:00
by anthony
In bash you will need to quote the '[5]' or bash will convert it to just '5' (no such file)