ImageMagick is a set of command line utilities to modify, transform, and convert images. The utilities are available for all major OSes.

learn more… | top users | synonyms

78
votes
6answers
76k views

How to install rmagick on Ubuntu 10.04?

Here's what I've done so far: sudo apt-get install imagemagick libmagickcore-dev This did not throw any errors, so I think that ImageMagick is installed fine. Then I tried installing the gem: sudo ...
37
votes
1answer
27k views

Combine multiple images using ImageMagick

I would like to combine multiple images into one image using ImageMagick. To explain a little better, I want the result to look similar to this: That is, I have a number of screen shots, and I want ...
31
votes
2answers
21k views

How do you re-install a package with Homebrew (Mac)?

Struggling to find good Homebrew documentation (or tutorial)... In the mean time I need to reinstall ImageMagick that was installed with Homebrew (brew install imagemagick) and not sure if I should ...
20
votes
3answers
3k views

Convert HTML to image

Background Batch convert various syntax-highlighted source files (C, SQL, Java, PHP, batch, bash) into high-resolution images (600dpi), suitable for an eBook and printed book. Failed Solutions A ...
16
votes
2answers
3k views

Why is the gif I created so slow?

I am using ImageMagick to turn a collection of pngs into a single gif. I want this gif to loop as quickly as possible. This is approximately the output I expect (courtesy of Wikipedia): This is ...
15
votes
8answers
12k views

I have compiled ImageMagick on my CentOS, and RMagick won't install

I installed ImageMagick through, (Using ImageMagick 6.7.3-7) ./configure --prefix=/usr && make && make install When I try to gem install imagemagick I get Building native ...
13
votes
6answers
18k views

How to merge pdf:s using Imagemagick (resolution problem)

When I try to merge two .pdf files using Imagemagick convert pdf1.pdf pdf2.pdf temp.pdf the resulting temp.pdf file seems to have very low resolution. How can I keep the resolution same as in the ...
11
votes
3answers
10k views

I want to change DPI with Imagemagick without changing the actual byte-size of the image data

I feel so horribly sorry that I have to ask this question here, but after hours of researching how to do an actually very simple task I'm still failing... In Gimp there is a very simple way to do ...
10
votes
2answers
11k views

Using Ghostscript to convert multi-page PDF into single JPG?

I know Ghostscript can convert PDFs to JPGs, and in the case of a multi-page PDF, can rip each page to an individual JPG. But is it possible to have it rip them to one JPG, so that the pages are ...
9
votes
1answer
381 views

Tile animated gifs

Is there some way to use imagemagic / montage to tile looped animated gifs (intermixed with nonanimated ones)? That is, I want to concatenate the animations in space, not in time. I realize that the ...
8
votes
2answers
4k views

Command Line loop to run command on all files in a directory (plus sub directories, if possible

I'm assuming this is fairly easy to do, but I have zero experience with Windows's command line utilities. Basically, I need to iterate over all files in a directory (great if it can do ...
7
votes
6answers
7k views

Square thumbnails with ImageMagick (convert)?

How to create square/cropped thumbnail using ImageMagick ? Cropping like below.
7
votes
4answers
2k views

How can I tell if my image is CMYK from Linux command line?

I'm converting images from RGB to CMYK. How can I tell if my image is CMYK from the Linux command line?
7
votes
3answers
7k views

Command line to automatically crop an image?

By using Gimp's menu, you can automatically crop the image (removing white borders). I have a lot of images with white borders of different sizes. I want to remove them using Gimp in command line but ...
6
votes
5answers
10k views

How to install RMagick RubyGem on Mac OS X 10.6 Snow Leopard?

I am getting this error while trying to install RMagick: $ sudo gem install rmagick Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to ...
6
votes
2answers
233 views

Mass recoloring of PNGs from command line

Similar to the mass rescaling command this site taught me here, is there a command-line trick for mass recoloring? To make it specific, suppose I have a bunch of images with RGB and alpha values: ...
4
votes
2answers
2k views

How to stretch an image in one dimension?

The title says much, but I'll explain in detail a little more. I need to stretch an image in one dimension only. That is, if the image is for example, 100x100 (Width x Height) I need it to be 100x104 ...
4
votes
5answers
2k views

Is there a server-side video manipulation software?

I'm looking for a hosted or self-hosted solution that will allow me to manipulate video files that are uploaded to a server by an end-user. Does anyone know of any solutions - open source or ...
4
votes
1answer
2k views

ImageMagick - Replace the transparent part of a GIF with a solid colour?

I have a GIF file that has a transparent section. I want to replace that with just plain white (or some other colour), so that there is no transparent parts. Can I do this on the command line with ...
4
votes
3answers
4k views

Using GraphicsMagick or ImageMagick, how do I replace transparency with a fill colour?

Using GraphicsMagick, it's fairly easy to replace one colour with transparency... gm convert -transparent magenta src.png dst.png Unfortunately, I can't figure out a simple way to do the exact ...
4
votes
1answer
2k views

Can ImageMagick make thumbnails from video?

I'm trying to extract thumbnails from video via ImageMagick. I found some samples from their official site, but it makes GIF, not PNG. I want a solid thumbnail though. Can it create the same output ...
4
votes
1answer
1k views

Convert grayscale image into alpha channel image in unix shell

I have a gray-scale image. I want to convert it into an transparent PNG, such that the black pixels (in the original image) become fully opaque, the white pixels become fully transparent, a 50% grey ...
4
votes
3answers
4k views

How do I change the canvas size of a PNG with ImageMagick (GraphicsMagick)? (How to pad with transparency?)

Alternatively: How do I take a non-square PNG and "fill out" the "rest" of the image with transparency so that the resulting square image has the original image centered in the square? ULTIMATELY, ...
4
votes
2answers
3k views

How can I deskew and crop PDFs made from scanned pages *automatically*? [duplicate]

Possible Duplicate: Which free software can I use to deskew scanned images I have several PDFs made up of book pages' scans. The scans are made from two pages at a time and some of these ...
4
votes
1answer
436 views

Parallel processing slower than sequential?

EDIT: For anyone who stumbles upon this in the future: Imagemagick uses a MP library. It's faster to use available cores if they're around, but if you have parallel jobs, it's unhelpful. Do one of ...
4
votes
2answers
1k views

ImageMagick Convert: How to produce sharp resized PNG files from SVG files?

I am using this command to generate a sharp 512px wide version of an SVG file that I have: convert -geometry 256 pinterest.svg pinterest.png This is the source file: <?xml version="1.0" ...
4
votes
1answer
63 views

Unable to install Imagemagick on Ubuntu 12.10

I've got a virtual machine running on Ubuntu 12.10. When I try to run apt-get install imagemagick I get several 404 errors: Err http://archive.ubuntu.com/ubuntu/ quantal-updates/main libcups2 ...
4
votes
2answers
374 views

Automating the choice between JPEG and PNG with a script

Choosing the right format to save your images in is crucial for preserving image quality and reducing artifacts. Different formats follow different compression methods and come with their own set of ...
4
votes
1answer
646 views

Thumbnail generation with imagemagick doesn't render the correct colors

Generating thumbnails of PDFs with imagemagick sometimes renders incorrect colors. We're using an old version of imagemagick (6.5.7-8, that's the version installed on the heroku servers). Here is the ...
4
votes
3answers
4k views

Resizing and cropping images to 6x4 to width of 1024

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

Vectorized fonts in PDF output of ImageMagick montage?

I am using ImageMagick (under Linux) to make a 3x3 montage of nine PNGs which I have, and label them. Desired is PDF output with vectorized fonts as the labels. I use this command: montage -label ...
3
votes
1answer
929 views

Appending images horizontally in ImageMagick

convert -append 1.jpg 2.jpg out.jpg This command appends 1.jpg and 2.jpg vertically. What is the command to do this horizontally?
3
votes
2answers
693 views

Convert BMP to PNG while preserving alpha channel

I have an image stored in BMP format and would like to convert it to PNG using imagemagick. I looked at the pixels in a hex viewer and noticed that they are stored in 32bpp, so there is an alpha ...
3
votes
1answer
4k views

Convert PDF to JPG images with ImageMagick - how to 0-pad file names?

I convert a pdf file to jpg images by using ImageMagick like this: convert -density 600 foo.pdf foo.jpg The created jpg images are named foo-1.jpg, foo-10.jpg and so on. Is there way to 0-pad the ...
3
votes
1answer
3k views

How can I remove “ImageMagick” completely?

I think I accidently did install 2 ImageMagicks to my CentOS 5.8 before. Version 6.2.8 was removed by yum erase ImageMagick However, it still shows this when I typed $convert -version Version: ...
3
votes
3answers
4k views

Bulk convert PNG-24 to PNG-8 files with best quality

Can anybody recommend a good method of bulk converting a large amount of PNG-24 files to PNG-8 with as little loss of quality as possible and maintaining transparency? I've tried ImageMagick but the ...
3
votes
2answers
2k views

Convert a series of PNGs to an animated gif or video file

I have a series of PNG image files that I want to convert into animation. What is the best way to convert them into a GIF? Also I have tried various tools to convert them into a video file (like ...
3
votes
1answer
601 views

Get crisp, clear thumbnails from MP4 with FFmpeg / ImageMagick

My ultimate goal is to get meaningful snapshots from videos that are either 30 min or 1 hour long. "Meaningful" is a bit ambitious, so I have simplified my requirements. The image should be crisp - ...
3
votes
3answers
572 views

Why does Imagemagick convert make the first page of output PDFs too large?

When I run convert *.jpg output.pdf the output looks like this: Why is the first page bigger then the others in the PDF? The original JPEGs were all the same size!
3
votes
1answer
279 views

How do I use cpulimit with ImageMagick?

I am converting (using ImageMagick) a directory of image files (using a bash for loop in shell). I notice that "convert" is taking up a large amount of CPU use (88% and up). However, If I try to ...
3
votes
2answers
1k views

PDF => raster, is it possible to adapt the sampling resolution to the input page size?

I am using convert (Imagemagick component, delegating to Ghostscript in background) to transform the first page of PDF files to images. Usually, convert -density 200 file.pdf[0] first_page.png will ...
3
votes
1answer
579 views

GraphicsMagick error reading PNG file

When trying to read a large PNG file, GraphicsMagick command gm convert pallaso1.png pallars-sobira.jpg just displays this error c:\progs\GraphicsMagick\gm convert: Read Exception (PALLASO1.PNG). ...
3
votes
1answer
822 views

How to average multiple images into one with ImageMagick?

convert -average darky1.jpg darky2.jpg lighty1.jpg lighty2.jpg l.ppm convert -average lighty1.jpg lighty2.jpg lighty1.jpg lighty2.jpg d.ppm l.ppm is much lighter than d.ppm. The order of images ...
3
votes
1answer
138 views

Convert image to pdf a5 with not empty areas

I'm using this command mogrify -format pdf -page a5 iguana2.jpg to convert a jpg file into a pdf. The problem is that the result has a white border. I'd like the image to full fill the a5 page ...
3
votes
1answer
178 views

transparent gradients with graphicsmagick

I'm trying to create a gradient that goes from transparent to some color. With imageMagick you can do that with (taken from the documentation): convert -size 100x100 gradient:none-firebrick ...
3
votes
1answer
862 views

Building ImageMagick on OSX Lion and can't link libpng

I am trying to build ImageMagick 6.8.0-5 on OSX Lion with support for libpng. I am just using the standard ./configure make make install procedure. I succeed in compiling when I do not reference ...
3
votes
1answer
995 views

Linux: concatenate several images into a PDF file with several images per page

I know that ImageMagick's convert program can be used as follows to convert a collection of images -- say, in PNG format -- to a PDF file: convert *png output.pdf The problem with this is that each ...
2
votes
6answers
3k views

Sort and rename images by date in EXIF info

I have a mess in my photos folder; I want to sort them according to date in EXIF information and rename according to the date (like 001.jpg, 002.jpg and so on). How can I do this in Linux? I have ...
2
votes
1answer
693 views

Use imagemagic to put several JPG on one page

I have a folder full of jpg files. When I use the following command, convert *.jpg assembly.pdf I get a pdf file with one image per page of the pdf. I would like to put 9 images on each page. Is ...
2
votes
2answers
399 views

Is it safe to use ImageMagick on user images?

I've heard there may be security concerns when using ImageMagick on arbitrary user-provided images. For example, the link below gives evidence that there used to be some buffer overflow exploits. ...