Extending Whilst Preserving Gif Transperancy

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
STT

Extending Whilst Preserving Gif Transperancy

Post by STT »

G'day,
I have a folder of ~100 animated .gif images with various transparency colours that I wish to enlarge into 40x40 images with the existing image centred.

Using "convert <image> -gravity center -extend 40x40 <newImage>" works but imposes a white background.
"convert <image> -gravity center -extend 40x40 -background none <newImage>" and
"convert <image> -gravity center -extend 40x40 -background transparent <newImage>" also imposes the background.
How do I do the extension without creating a white background?

Cheers,
STT
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Extending Whilst Preserving Gif Transperancy

Post by snibgo »

Perhaps "-resize" will do what you want.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Extending Whilst Preserving Gif Transperancy

Post by fmw42 »

put the -background color BEFORE the -extent
STT

Re: Extending Whilst Preserving Gif Transperancy

Post by STT »

snibgo wrote:Perhaps "-resize" will do what you want.
Nah, that would have distorted the images. :P
fmw42 wrote:put the -background color BEFORE the -extent
Cheers, that did exactly what I wanted.
Post Reply