How to Flatten ImageMagick image from layer 0 to Canvas?

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
turbz
Posts: 1
Joined: 2012-01-14T16:07:33-07:00
Authentication code: 8675308

How to Flatten ImageMagick image from layer 0 to Canvas?

Post by turbz » 2012-01-14T16:12:08-07:00

When I create a layered image in ImageMagick the result PNG has a Layer 0 instead of a being on a Canvas Background. I've used flatten image function but it drags it down to Layer 0 which I believe is a combination of all the flattened images.

How can I flatten this down to Background Canvas?

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

Re: How to Flatten ImageMagick image from layer 0 to Canvas?

Post by anthony » 2012-02-16T00:13:28-07:00

Flatten creates a background canvas by clonin the first (0 index) image. The color is the current background color of the first image. Each image is then composed onto that canvas using the current per-image compose setting in sequence.

I do not know what you mean by a difference between background and 0 index image in PNG. PNG images as far as I understand is just a single image, though it may have a layer offset, and/or a IM specific canvas size information profile.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
http://www.imagemagick.org/Usage/

Post Reply