Psd Layers

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply

Psd Layers

Post by klexx » 2007-07-08T15:52:10-07:00


Currently I'm successfully extracting the layers of an psd image into seperate files. Now I have the problem that these images are only the size of the content of the layer.

Is there a way to find out the position of the content in the original layer?
My goal is to put them on a webpage one over another so that it looks like the original psd image.

I hope I made myself clear.
thx in advance

User avatar
Posts: 8881
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Psd Layers

Post by anthony » 2007-07-12T01:34:04-07:00

You can also look at using the other GIF animation techniques, which uses the same virtual canvas and canvas offsets methods (just no complex disposal methods).

Especially look at the 'gif_anim_montage' script. which 'dims' previously overlayed images, so you can see how th new image overlays and what parts it draws, relative to the other overlays.

yes this is all commandline, but it should all be directly translatable to MagickWand programming.

If you are just wanting the final image use Flatten (with the approriate background color.

If the individual layer are smaller. -trim will trim the edges and retain the canavs and offset information as appropriate. To remove the colors in overlays that don't chnage the results use the Transparency Optimization method
It replaces any overlaid pixels that don't change the background (more than the current -fuzz setting) with transparency.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages

Post Reply