ImageMagick is an open source image editing software suite for displaying, converting, and editing raster image files. It supports read/write for more than 100 image file formats.

learn more… | top users | synonyms

21
votes
9answers
31k views

Converting multiple image files from JPEG to PDF format

I want to convert some files from jpeg to pdf. I am using following command. $ convert image1.jpg image1.pdf But I have 100 images. How should I convert all of them to corresponding pdfs? I ...
16
votes
6answers
720 views

How to type several file names with fewer key strokes

If I want to convert a pdf to a png image with imagemagick I do something like: convert -trim -density 400 this_is_a_very_long_filename_of_my_pdf_file.pdf ...
16
votes
5answers
18k views

Creating a GIF animation from PNG files

Is there a tool to create a gif animation from a set of png files? I tried the convert command from the ImageMagick suite, but this doesn't always succeed. Also, I have several issues with this: I ...
16
votes
4answers
21k views

How can I convert a PNG to a PDF in high quality so it's not blurry or fuzzy?

There are a lot of questions out there about how to convert a PDF file to a PNG image, but I'm looking to take a nice sharp PNG file and just basically wrap it or embed it in a PDF file without having ...
15
votes
5answers
14k views

convert images to pdf: How to make PDF Pages same size

I did something like convert -page A4 -compress A4 *.png CH00.pdf But the 1st page is much larger than the subsequent pages. This happens even though the image dimensions are similar. These images ...
11
votes
6answers
21k views

How to convert TXT to PDF?

I want to convert .txt files to .pdf. I'm using this: ls | while read ONELINE; do convert -density 400 "$ONELINE" "$(echo "$ONELINE" | sed 's/.txt/.pdf/g')"; done But this produces one "error" -- ...
11
votes
1answer
793 views

How to generate a lot of (blank) images files?

For a test, I need to quickly create 1700 jpg-images (even blank) in a defined size 1000x706. I wonder if we could do this with a shell script or a program (like ImageMagick). I wish they called ...
11
votes
3answers
2k views

remove extra tilespace from a montage (ImageMagick) composite image?

I have a bunch of photos. They're all the same height, and I'm trying to put them together into a composite image using ImageMagick's montage program via Bash. The problem is that by default, the tile ...
9
votes
4answers
15k views

pdf to jpg without quality loss; gscan2pdf

When I convert a pdf file to bunch of jpg files using convert -quality 100 file.pdf page_%04d.jpg I have appreciable quality loss. However if I do the following, there is no (noticeable) quality ...
7
votes
4answers
700 views

Iterate over n files?

I've got something fairly simple I want to do. I want to use montage on a directory that contains thousands of images, with very few options, namely: me@home$ montage -size 256x256 DSC01*.JPG.svg ...
7
votes
1answer
159 views

Combine multiple PDF files into one (arranged in a matrix)

Having a set of PDF files, lets say: in-01.pdf, in-02.pdf, in-03.pdf, ... I would like to combine all of them into a single one, forming an M x N matrix. The command montage allows for doing so (M ...
6
votes
3answers
600 views

ImageMagick on multiple files

I have converted a single file from BMP to PNG with ImageMagick's convert using the command below convert CD\ Front.bmp CD\ Front.png I have many such files, thus I tried: for f in */*.bmp ; do ...
5
votes
3answers
321 views

How to rescale several images to same size

I have several image files in a directory. These images are similar size and have same background color. How can I make all images same size by adding background like this attached image?
5
votes
2answers
4k views

How to convert a color pdf to black-white?

I'd like to transform a pdf with some coloured text and images in another pdf with only black&white, in order to reduce its dimensions. Moreover, I would like to keep the text as text, without ...
5
votes
3answers
2k views

Command line convert webp to jpg?

I'm using ubuntu 12.04. I've installed libwebp2 & libwebp-dev So far, no example found on the net of converting webp to jpg. Some webp files can easily converted by using imagemagick with ...
5
votes
1answer
1k views

imagemagick creating one big image by piling up thousand of images of the same width?

I've got a few tens of thousands of images all of 2000 pixel width, and I would like to pile them up in one big image of summed up height and 2000 pixel width. I guess there must be a way to do that ...
5
votes
2answers
3k views

How can I add invisible watermark to images on commandline?

Similar question here but for Tex -document. Imagemagick shows ways of watermarking here but not how to do it as invisible as possible. I currently just obfuscate some functional elements into photos ...
5
votes
2answers
179 views

Imagemagick resize

I am familiar with convert -resize % for decreasing a size by percentage but what is the command to increase an image from say 700 pixels to 800 pixels? Horizontal width should resize, too. I need ...
5
votes
3answers
1k views

terminal transparency, Imagemagick, and X11 root window problem

In Ubuntu Natty and in Fedora 12, I have urxvt (with 256 colours), and use ImageMagick (display -window root [...]) to set the root window to a picture. When I use the transparency (-tr) option on ...
4
votes
2answers
5k views

Use convert to grab a specific page from a PDF file?

I know I have done this before, so I'm sure it's possible, I just forget how to do it. There's a way to tell convert to grab a specific page of a PDF, and I'd like to keep the format of that page as ...
4
votes
1answer
2k views

Resizing and croping images to an aspect ratio of 6x4 with width of 1024 pixels

I have a mixed set of images, each one has a slightly different resolution with a slightly different aspect ratio from other images. I have tried using commands like convert -resize and convert ...
4
votes
1answer
3k views

Use imagemagick to convert opaque color to alpha

I have an image with a black background with white elements in the foreground. The image has smoothing, so there are 'in-between' pixels that aren't strictly black or white. I'd like to make the ...
4
votes
1answer
563 views

Resize a very tiny xcf image without blurring or dithering it

I have some drawings I made with an Intuos tablet. All of these drawings are 25x35 or so. The color of each pixel was very carefully selected. They're kind of like 'miniatures.' I need to resize ...
4
votes
1answer
223 views

Imagemagick: set IPTC parameters in jpeg image

With the Imagemagick command $ identify -verbose image.jpg so many properties of the image are shown. For example, in the output I can find Profiles: Profile-8bim: 1058 bytes Profile-iptc: 1017 ...
4
votes
1answer
645 views

ImageMagick (or other) for UTF-8 text to image

I'm trying to create many single-character images using convert. The purpose is to provide a plastics specialist with images to print onto keyboard keycaps. The ImageMagick documentation suggests ...
4
votes
1answer
514 views

how to center vertically tiled watermark

I use imagemagick to add a watermark to my photos. The command line is the following: composite -tile -gravity center watermark.png somefile.jpg somefile.jpg But the watermark isn’t centered ...
4
votes
1answer
53 views

Ways to convert and combine image files into a pdf file?

I have about 190 image files (png and jpg) in a directory. For more information, each image has 2500 x 3072 pixels, and about 500KB. I use the command convert from ImageMagik to convert and combine ...
4
votes
1answer
1k views

convert pdf to image [jpeg|png]

I need to convert pdf files into image files (like: png (prefer), jpeg). I used convert (from the ImageMagick package) but it takes more than 4 seconds for a 2 page pdf file with only tables ...
3
votes
5answers
1k views

Bash: Fastest way of determining dimensions of image from URL

I'm trying to figure out a really fast method in bash of determining an images dimensions. I know I could wget the image and then use imagemagick to determine the height and width of the image. I'm ...
3
votes
1answer
334 views

Omitting extension with find?

I need to create thumbnails from multiple .png files and would like to do this using ImageMagicks convert utility. To recursively find all files that are not thumbnails themselves, I am using the ...
3
votes
4answers
3k views

convert single-page landscape pdf into rescaled double-page portrait pdf

I'm having trouble using convert to do the following: I have a bunch of single-page pdf files whose geometry corresponds to a landscape A4 sheet. The actual content is visually split in 2 pages. ...
3
votes
1answer
2k views

How can I use imagemagick's identify command in a script to tell if a JPEG file is invalid or corrupt?

I have a somewhat-kludgey script in which I want to copy valid, complete JPEG files to a photo album directory. I thought I could use ImageMagick's identify command to do this. The web documentation ...
3
votes
1answer
656 views

Imagemagick -quality 85 doesn't work

I run mogrify to compress a JPEG image to 85% quality: $ ls -lah Screenshot.jpg -rw-rw-r--. 1 USER GROUP 440K May 24 12:10 Screenshot.jpg $ mogrify -compress JPEG Screenshot.jpg -quality 85 $ ls ...
3
votes
1answer
73 views

Why is ImageMagick's `compare` command so slow and is there an alternative?

I have a shell script running on an little Atom based Micro-ATX box that is doing some watchdog-like functions for a number of devices on a local network. One of the things it's doing is monitoring ...
3
votes
2answers
617 views

Oneliner for slicing an image?

I'm looking for a oneliner command that would slice an image into given proportions. Say input would be filename and slice dimensions. Are there any standard command-line tools for this? I tried ...
3
votes
1answer
1k views

imagemagick's convert unexpectedly changing the background color

what I'm trying to achieve is to pull a simple graphic from a webserver and use imagemagick to change a few colors so that I can then further use this image. This is the imagemagick portion: convert ...
3
votes
2answers
634 views

Running two animations side-by-side using ImageMagick

I have two animations (.gif files) I want to run side-by-side. Can this be done with ImageMagick? Moreover, I want to start one of the gifs after thirty frames of the other have passed. Can this be ...
3
votes
1answer
119 views

Colour problem when capturing a png of the top panel of the screen

I want to capture a window as a png from within a bash script, using the window's ID. In this case, the window is the top panel.  Using gnome-screenshot the colours are true, as per this image... ...
3
votes
0answers
783 views

Generating a slideshow under linux

Under Windows, one is able to generate a nice slideshow (crossfading between images, applying the Ken Burns effect on each image) on Windows using (Windows) Movie Maker. When I create a slideshow ...
2
votes
2answers
20 views

How to resize only the missized images?

I have a directory with 10,000 JPEGs. I made a mistake while generating the files and now some are 720px × 480px, but they should all be 448px × 336px. The directory contains both the too large files ...
2
votes
1answer
1k views

Convert pdf to jpg keeping the same name; resize & create thumbs then rename?

I have a lot of pdf files (3308) on which I must apply four steps: 1) I have to convert all to jpg I found this little script on the web with ImageMagick: batch converting pdf to jpg I want to do ...
2
votes
1answer
508 views

Use convert or ghostscript to grab the odd-numbered pages of a PDF

I have a PDF that consists of several hundred pages of bilingual text. Since I need to use OCR on each language separately, I want to grab the even and odd pages and make two separate PDFs, using ...
2
votes
2answers
102 views

How to split an image vertically using the comand line?

So, say I have a large 800x5000 image, how would I split that into 5 separate images with dimensions 800x1000 using the command line?
2
votes
1answer
682 views

convert pdf to png with resize and adding black border

I try to convert the first page of a book to a png, scale the png to a certain size and add a black border. This is what I tried: convert tmp.pdf\[0\] -background white -alpha remove -border 8 ...
2
votes
2answers
324 views

Remove nth frames of a gif (remove a frame every n frames)

I've recorded a .gif of the screen with ffmpeg. I've used gifsicle and imagemagick to compress it a bit, but it's still to big. My intent is making it small by removing, say, a frame every 2 frames, ...
2
votes
2answers
992 views

Convert a lot of .tif files using imagemagick's mogrify command

I have a lot of tif images in a directory. So I try to convert them into jpg format. I use this command : mogrify -format jpg *.tif But I get an error... an error for each image in fact: mogrify: ...
2
votes
2answers
1k views

ZSH: Stripping path, filename and extension from a list of files for piping a command

The syntax for the command convert in ImageMagick is convert source_filename.ext1 destination_filename.ext2 I would like to use zsh to feed it with files in a folder path_to_source and output the ...
2
votes
1answer
497 views

How to convert, resize and center image with ImageMagick

I'm unable to center a converted *.png file with ImageMagick's gravity option. Gravity seems to have no effect in the following command. On the contrary it erases everything and the output becomes ...
2
votes
3answers
688 views

Howto recursively create PDF thumnbails on linux command line

I am able to use ImageMagick to create a thumbnail of the first page of a PDF using: convert -thumbnail x80 95.pdf[0] thumb_95.png This works fine and generates a thumb_95.png file. I have tried ...
2
votes
1answer
40 views

Sorting image files based on whether the content is picture or graphics: updating an older solution?

Someone wanted to sort files in a directory according to whether the files are pictures(camera) vs. design graphics. On Stackoverflow, there is an older solution/proof-of-concept involving the ...