I need to read a file into imagemagick via the cli, and only work with the first image in the sequence.
There are two options:
convert 'foo.gif[0]' foo.jpg
convert -delete 1--1 foo.gif foo.jpg
Is there any real difference between them? or is there another optimized way to read in just the single image in the sequence?
thanks
-daniel
Reading only first layer
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Reading only first layer
I am not actually sure if the first example actually reads all images into memory before selecting frames. That area of the code is a convoluted, and I have not followed it through fully.bondu wrote:I need to read a file into imagemagick via the cli, and only work with the first image in the sequence.
There are two options:Is there any real difference between them? or is there another optimized way to read in just the single image in the sequence?Code: Select all
convert 'foo.gif[0]' foo.jpg convert -delete 1--1 foo.gif foo.jpg
thanks
-daniel
I'll forward this question to Magick who is probably the only one who can answer.
NOTE for second line of code... You should read the images in before trying to delete them
Code: Select all
convert foo.gif -delete 1--1 foo.jpg
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/