Page 1 of 1

Overlapping frames in gif-animation (convert)

Posted: 2018-08-19T07:45:30-07:00
by pb42
Hi IM users. I am trying to create at small (34x14 px) animated gif (a rolling pair of eyes) using IM. (Input files are transparent 34x14 tiff-files.)
I have tried
  1. convert -delay 80 -loop 0 *.tif re.gif
  2. convert -delay 80 -loop 0 -dispose previous *.tif re.gif
but the frames are overlapping (in 1. completely, in 2. partially). See (result from running 1.) https://drive.google.com/open?id=16A3Z ... RCmLJCocM4 .

How can I get a "non overlapping frame" animation with a transparent background?

/Peter

Re: Transparent gif via convert?

Posted: 2018-08-19T07:49:08-07:00
by snibgo
It's hard to comment without seeing your inputs. I suggest you zip them together and paste a link to the zip.

Re: Overlapping frames in gif-animation (convert)

Posted: 2018-08-19T08:11:05-07:00
by pb42
Thanks snibgo, as per your request: https://drive.google.com/open?id=1IQe34 ... IR90zxCMUY . (It's only a subset of the tiffs - half a rolling eye :) .

It turns out that command 2. in post 1 is almost there, except that the first image (the "sleeping eye", 00-sleep.tif) is shown in all the frames (image 2, 3, ... are only shown once as wanted).

Re: Overlapping frames in gif-animation (convert)

Posted: 2018-08-19T08:37:01-07:00
by snibgo
Your inputs have a range of transparencies, but the GIF format can record only binary transparency: on or off.

Re: Overlapping frames in gif-animation (convert)

Posted: 2018-08-19T08:39:05-07:00
by pb42
Hehe - there is of course this beautiful "hack": Create an empty new first (transparent) image (it doesn't matter that it's been displayed in all the frames) :lol: The result can be seen here: https://drive.google.com/open?id=19Bav6 ... L3bthhqxja .

(Command is: convert -delay 60 -loop 0 -dispose previous ../empty.tif *.tif re-using-empty-first.gif)

Re: Overlapping frames in gif-animation (convert)

Posted: 2018-08-19T08:41:40-07:00
by pb42
snibgo wrote: 2018-08-19T08:37:01-07:00 Your inputs have a range of transparencies, but the GIF format can record only binary transparency: on or off.
I see, thanks. So which, preferably lossless, image file format would you recommend for the input files (I need a transparent background)?

Re: Overlapping frames in gif-animation (convert)

Posted: 2018-08-19T08:56:47-07:00
by snibgo
The input file format makes no difference.

The problem is that your input images have partial transparency, and they rely on this for the effect. (All the pixels are black, but with varying transparency.) But gif doesn't support partial transparency.

Re: Overlapping frames in gif-animation (convert)

Posted: 2018-08-19T09:18:26-07:00
by pb42
Thanks snibgo. (But I'm not sure I understand what to do differently though...)

Using the above mentioned "hack" (insert an empty ad hoc first image) the final animation can be seen in my signature.