Page 1 of 1
How to extract gif image to multiple png/jpg images?
Posted: 2013-01-13T01:18:37-07:00
by agriz
I want to extract gif image and then i want to join them using ffmpeg.
How do i extract those layers from gif?
Is it right?
It is not clearly extracting images from gif.
Re: How to extract gif image to multiple png/jpg images?
Posted: 2013-01-13T10:49:05-07:00
by snibgo
That should extract the images. What happens instead? What error messages do you get? Do you get any images?
(For input to ffmpeg, each image must represent the entire frame, rather than merely a difference. So you may need other IM options, such as "-coalesce").
Re: How to extract gif image to multiple png/jpg images?
Posted: 2013-01-13T11:33:43-07:00
by agriz
I have some strange outputs.
The first frame of the gif is extracted correctly.
But the second and other frames are having only the animated part. The original image around / behind (or wherever) is missing.
But i tried to use the identify function from imagemagick. Which game me the output the of the scenes in the gif image.
If the scenes are 10, then i tried the following which game me the correct extracted images.
Code: Select all
convert img.gif[11] img/xx_%05d.png
The images are extracted like this
xx_00001-0.png
xx_00001-1.png
...
(however there was some error thrown. But the images are extracted)
Re: How to extract gif image to multiple png/jpg images?
Posted: 2013-01-13T12:16:53-07:00
by snibgo
agriz wrote:The original image around / behind (or wherever) is missing.
snibgo wrote:(For input to ffmpeg, each image must represent the entire frame, rather than merely a difference. So you may need other IM options, such as "-coalesce").
agriz wrote:however there was some error thrown.
What was the error?
Re: How to extract gif image to multiple png/jpg images?
Posted: 2013-01-13T13:54:33-07:00
by glennrp
agriz wrote:I have some strange outputs.
The first frame of the gif is extracted correctly.
But the second and other frames are having only the animated part. The original image around / behind (or wherever) is missing.
The GIF is "optimized" so only the aniimated part is present. When you show it on a display, each partial frame is written over what's
already on the screen. Use
Code: Select all
convert -coalesce img.gif[11] img/xx_%05d.png
to "Fully define the look of each frame of an GIF animation sequence".
But i tried to use the identify function from imagemagick. Which game me the output the of the scenes in the gif image.
If the scenes are 10, then i tried the following which game me the correct extracted images.
Code: Select all
convert img.gif[11] img/xx_%05d.png
The images are extracted like this
xx_00001-0.png
xx_00001-1.png
...
I guess you need to "escape" the percent-sign if you are running on some operating system where the "%" means something to the shell.
How to "escape" a symbol depends on your system. It could be "%", '%', \%, or maybe something else.
Re: How to extract gif image to multiple png/jpg images?
Posted: 2013-01-13T22:04:00-07:00
by agriz
I am using fedora 17
Re: How to extract gif image to multiple png/jpg images?
Posted: 2013-01-13T23:00:59-07:00
by fmw42
try
convert img.gif -coalesce img/xx_%05d.png
Re: How to extract gif image to multiple png/jpg images?
Posted: 2013-01-13T23:39:07-07:00
by agriz
fmw42 wrote:try
convert img.gif -coalesce img/xx_%05d.png
Thanks
works perfectly!!!