Page 1 of 1
Extract image from GIF using index
Posted: 2006-09-18T07:10:34-07:00
by howa
to extract image from animated gif, using index
such as. convert test.gif[0] test2.gif
but if the input is not animated gif, such as jpg, png, will there be any harmful effect?
e.g.
convert test.jpg[0] test2.jpg
from my testing, seems they are ok, isn't?
Posted: 2006-09-18T07:42:15-07:00
by magick
There are no side-effects when appending [0] to a non-animated image format such as imaage.jpg[0].
Posted: 2006-09-18T07:47:24-07:00
by howa
thanks first...
one more question...
which parameter can set the quality for all input file types, such as gif, png, and jpeg?
seems `quality` only apply to png & jpeg
i want a global command which can set the quality and hence control hthe file size no matter the input type
thanks.
Posted: 2006-09-18T16:52:39-07:00
by anthony
GIF does not have a quality, though it does have a compression. Most people just leave this as default though.
GIF is limited to a maximum of 256 colors, minus one is transparency is wanted.
JPEG is lossy and losses information, such that it is a minimal loss visually for real world images. PNG quality is NOT a percentage as it is for JPEG, and does not loss information, but is also a lot larger to store images.
See IM examples, Common Formats for a summary and more details.
http://www.cit.gu.edu.au/~anthony/graph ... s/#summary
Posted: 2006-09-22T14:40:34-07:00
by glennrp
- identify -verbose file.gif
Posted: 2006-09-22T23:25:38-07:00
by anthony
For a more concis figure...
What do you need it for? Generally you try to create commands that do not depend on the number of images in a animation, though that is not always posible.
Posted: 2006-09-23T19:02:00-07:00
by anthony
To divide up all the frames use +adjoin to turn off 'merge multiple images into one file'.
See examples and file numbering in
IM Examples, Image File Handling, Writing a Multi-Image Sequence
http://www.cit.gu.edu.au/~anthony/graph ... #write_seq
You may also like to look at the special scripts in Animation Basics Page.
Specifically "gif2anim" and "anim2gif"
http://www.cit.gu.edu.au/~anthony/graph ... /#sequence
This script not only seperates out the individual frames of the animation, but also generates a ".anim" file that lists the IM "convert" options needed to re-produce the original animation.
That is all the time delays and GIF frame disposal methods that were used for each frame in the animation.
Quite a number of options too.
The "anim2gif' script reverses the process by substitung the BASENAME and feeding the file to "convert".