Page 1 of 1

Reading only first layer

Posted: 2011-11-04T16:05:35-07:00
by bondu
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

Re: Reading only first layer

Posted: 2011-11-08T18:46:08-07:00
by anthony
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:

Code: Select all

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
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.

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