newbe transparent layer question

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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: newbe transparent layer question

Post by Bonzo »

Remember jpg does not use transparency so if any area is to stay transparent you will need to save it as a png or gif.

Code: Select all

composite -gravity center transparent.gif photo.jpg result.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: newbe transparent layer question

Post by anthony »

Also as JPG has no transparency, placing things UNDER a JPG image will never be seen. Now if the GIF with a transparent window is OVER a JPG then the JPEG will be visible through the window.

Again as JPG is involved, unless the Alpah composition operator adds transparency (a masking operation) then the result will not have any transparency.

Of course to add transparency to a JPEG you need to tell Im to give it a alpha or matte channel using -matte
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply