Page 1 of 1
Layer offset when flattening PSD on Linux
Posted: 2008-05-21T19:52:53-07:00
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?
Re: Layer offset when flattening PSD on Linux
Posted: 2008-05-21T20:23:01-07:00
by magick
Try the following:
- convert 'image.psd[0]' image.jpg
Re: Layer offset when flattening PSD on Linux
Posted: 2008-05-23T08:55:49-07:00
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).
Re: Layer offset when flattening PSD on Linux
Posted: 2008-05-24T05:11:49-07:00
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.
Re: Layer offset when flattening PSD on Linux
Posted: 2008-05-29T18:31:15-07:00
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.