extent & alpha background

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
errx
Posts: 4
Joined: 2011-10-27T07:25:00-07:00
Authentication code: 8675308

extent & alpha background

Post by errx »

I have image with alpha background. But after extent it

Code: Select all

convert -extent 100x100 in.gif out.gif
my background isnt transparent anymore. How can I fix it?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: extent & alpha background

Post by fmw42 »

errx wrote:I have image with alpha background. But after extent it

Code: Select all

convert -extent 100x100 in.gif out.gif
my background isnt transparent anymore. How can I fix it?

First put the input image right after convert, then specify -background color and -gravity posititioning. Try

convert in.gif +repage -gravity center -background none -extent 100x100 out.gif

The +repage is there in case your gif has a virtual canvas larger than the image.
Post Reply