Flattening opaque layers in PSDs

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Flattening opaque layers in PSDs

Post by fmw42 »

With PSD images, I believe the first frame is the composite of all the layers.

So use that to get the psd composite layer or pick the layer or layers you want.

convert test.psd[0] -flatten test.jpg
convert test2.psd[0] -flatten test2.jpg



If you do identify -verbose on your two images, you will see that some frames have no alpha channel, others have one-bit alpha and others have grayscale alpha (including one that has 15-bit alpha???). But the first frame of the first image has no alpha and the first frame of the second has 1-bit alpha.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Flattening opaque layers in PSDs

Post by anthony »

If all layers have some transparency, Then it is a good idea to set a 'background' color, even if that background is just 'transparent' or 'none'.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply