Trimming animation
Posted: 2011-12-07T06:03:35-07:00
Hi,
I made an animation from a sequence of PNG images. So far, so good.
Now, I would like to automatically trim the animation just like we do
when we trim images but I need all images to preserve their relative
position. AFAICS, this means that I have to compute a minimal
bounding box that includes all the relevant pixels from all images
and then I should use that bounding box to trim each image.
My first attempt was this:
convert frame-*.png -trim -layers TrimBounds -coalesce +repage film.pdf
The result is not what I want because it looks like each image was
trimmed independently. As a result, if the next image is smaller
than the previous one, we still see fragments of the previous one.
I managed to "solve" the problem by taking advantage of the fact
that the trimmed areas are black:
convert frame-*.png -background Black -layers TrimBounds -dispose Background -trim +repage film.pdf
However, this is not a general solution and, moreover, it sometimes
show some artifacts, such as very thin lines that appear and disappear
during the animation.
So, my question is: how can I trim an animation?
Thanks a lot,
António.
I made an animation from a sequence of PNG images. So far, so good.
Now, I would like to automatically trim the animation just like we do
when we trim images but I need all images to preserve their relative
position. AFAICS, this means that I have to compute a minimal
bounding box that includes all the relevant pixels from all images
and then I should use that bounding box to trim each image.
My first attempt was this:
convert frame-*.png -trim -layers TrimBounds -coalesce +repage film.pdf
The result is not what I want because it looks like each image was
trimmed independently. As a result, if the next image is smaller
than the previous one, we still see fragments of the previous one.
I managed to "solve" the problem by taking advantage of the fact
that the trimmed areas are black:
convert frame-*.png -background Black -layers TrimBounds -dispose Background -trim +repage film.pdf
However, this is not a general solution and, moreover, it sometimes
show some artifacts, such as very thin lines that appear and disappear
during the animation.
So, my question is: how can I trim an animation?
Thanks a lot,
António.