ImageMagick creates multiple files

I am running the following:

convert '/var/www/Standard Features.tif' '/var/www/Standard Features.jpg'

      

and for some reason I am creating 2 files:

-rw-r--r--  1 root   root    31809 Jan 27 23:53 Standard Features-0.jpg
-rw-r--r--  1 root   root    20899 Jan 27 23:53 Standard Features-1.jpg

      

Why is this happening and how can I make it stop? I can't figure out why this is happening. I've tried changing the parameters and that's it, but nothing works. Thank.

+3


source to share


3 answers


convert in.tif -delete 0 out.jpg

      

or

convert in.tif -delete 1 out.jpg

      



You will be trying to convert a multi-catalog TIFF that translates to convert

image stacks. The argument -delete

specifies the stack indices to be removed (when there is only one image left on the stack, only one image will be displayed).

Multi-disc TIFFs do have multiple images, so you have to be careful with what you actually discard.

+4


source


I found this to be more useful when dealing with output, as it doesn't require knowing how many files ImageMagick will generate. This is only useful if you only want the first image:

convert in.tif -delete 1--1 out.jpg

      

1 - the second created image (index 0)



-1 - the last created image

Thus, 1- -1 is the range from the second to the last generated image. Your output will be out.jpg instead of out-0.jpg.

0


source


TIFF files can have multiple pages. GIF files can have multiple frames and PDF files can have multiple layers. Converting this will give multiple outputs, one for each page / frame / layer.

If you only want one page / layer / image frame in ImageMagick, just add [x] to the name of your input file. For example, if you just want the first TIFF page then

convert image.tiff[0] out.jpg

      


See Selecting Frames

.If you want a series of pages, use eg [3-27].

If you are using ImageMagick 7, replace the conversion with magic.

0


source







All Articles