Layer offset when flattening PSD on Linux

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
rzuris

Layer offset when flattening PSD on Linux

Post by rzuris »

I received a PSD with 5 layers that when I convert it to JPEG and specify -flatten, one layer winds up a couple hundred pixels too far down and to the right of where it belongs, but only on Linux (CentOS 4 and Red Hat Enterprise 4). On Windows, it flattens correctly; I can see that the now-flattened layer is placed in correct position over the base. Originally I was testing version 6.3.3 on Windows and 6.3.5 on Linux, but then I upgraded both machines to 6.4.1-3 and got the same results.

Any ideas on what I should check?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Layer offset when flattening PSD on Linux

Post by magick »

Try the following:
  • convert 'image.psd[0]' image.jpg
rzuris

Re: Layer offset when flattening PSD on Linux

Post by rzuris »

Okay, I can do that, but can you explain what you're looking for? That's only going to convert the base layer and I'll lose the other layers. I'm using -flatten because I want to keep all layers. The layer that is offset is important to the final image (it applies a gray gradient fill to one particular region of the image, which is otherwise a flat white).
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Layer offset when flattening PSD on Linux

Post by Bonzo »

From what I have read the [0] layer should contain all the layers.

http://www.rubblewebs.co.uk/imagemagick/psd.php
NOTE: When you look at the first example you will see the code created 4 images the finished image and all the layers; so for example this psd file has:
layer[0] = The complete image
layer[1] = The background layer
layer[2] = The image layer
layer[3] = The text layer
So to convert the complete image and ignore the layers you would use:

<?php
exec("convert boots.psd[0] -thumbnail 340x340 boots_png.png");
?>

This is only for images that have not been "merged" as they will only have the one layer.
If not can you let me know and I will update my psd page again.
rzuris

Re: Layer offset when flattening PSD on Linux

Post by rzuris »

[quote="Bonzo"]From what I have read the [0] layer should contain all the layers.

Okay, it appears that layer [0] contains the full image. Is that only for PSDs? What about multi-layer TIFFs? I have been using -flatten to get the full image for either of these formats.
Post Reply