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
klexx

Psd Layers

Post by klexx »

Hi,

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
klexx
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Psd Layers

Post by anthony »

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).

http://www.imagemagick.org/Usage/anim_basics/#coalesce

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.
http://www.imagemagick.org/Usage/mosaics/#flatten

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
http://www.imagemagick.org/Usage/anim_opt/#opt_trans
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
https://imagemagick.org/Usage/
Post Reply