Questions tagged [imagemagick]

ImageMagick is an open source software suite for displaying, converting and editing raster image files.

The software mainly consists of libraries and a number of utilities for manipulating images.

File format conversion

One of the basic and thoroughly-implemented features of is its ability to efficiently and accurately convert images between different file formats. Over 100 different formats are supported.

Language Bindings

There are ImageMagick bindings for most popular programming languages including , , , , , , , , , , , and . There are also bindings for which only operate in Mac OS X and Linux, not iOS.

Distribution

is cross-platform, and runs on all recent versions of Microsoft Windows (except Windows 95), and Unix-like systems including Mac OS X, Linux, Solaris, and FreeBSD. The project's source code can be compiled for other systems, including AmigaOS 4.0 and MorphOS.

Resources

9193 questions
78
votes
2 answers

ImageMagick: scale JPEG image with a maximum file-size

I have a number of JPEG pictures which I would like to scale down. Another requirement is that the file size should not be larger than say 300kByte. Is that possible, please help me with an example =)
kungcc
  • 1,832
  • 5
  • 25
  • 48
78
votes
4 answers

How to execute ImageMagick to convert only the first page of the multipage PDF to JPEG?

How do I execute ImageMagick's convert if I want a JPEG from the first page only of a multi-page PDF?
V A S
  • 3,338
  • 4
  • 33
  • 39
77
votes
8 answers

Convert RGB to Grayscale in ImageMagick command-line

How do I convert a RGB image (3 channels) to a grayscale one, using the (r+g+b)/3 method? I look through an examples page: http://www.imagemagick.org/Usage/color_mods/#grayscale but the desired method: convert test.png -fx '(r+g+b)/3'…
egor7
  • 4,678
  • 7
  • 31
  • 55
74
votes
13 answers

ImageMagick no decode delegate

I'm trying to convert an image with imagemagick, but I'm getting this error: convert: no decode delegate for this image format `//i.imgur.com/nTheJ.jpg' @ error/constitute.c/ReadImage/532. I'm doing this: convert http://i.imgur.com/nTheJ.jpg…
Trolley
  • 2,328
  • 2
  • 23
  • 28
74
votes
2 answers

ImageMagick: Error while running convert: convert: unable to read font

I'm on Mountain Lion and installed ImageMagick using Homebrew (minimagick is also in my Gemfile but I don't think that's relevant). SimpleCaptcha uses it in a Rails app to create CAPTCHAs. However, the image isn't created cause of this error: Error…
Agis
  • 32,639
  • 3
  • 73
  • 81
72
votes
5 answers

Imagemagick Convert PDF to JPEG: FailedToExecuteCommand `"gswin32c.exe" / PDFDelegateFailed

I have PDFs that I need to convert to images. I have installed Imagemagick. I have a PDF named a.pdf that I can open (it is not corrupt) in the folder C:\Convert\ From the command line I am trying C:\Convert>convert a.pdf a.jpg And I am getting…
MatthewD
  • 6,719
  • 5
  • 22
  • 41
71
votes
13 answers

ImageMagick and OS X Lion trouble

[edit] I was troubleshooting problems with my development environment when I noticed one of my problems was the dependency on ImageMagick, since it's a vital part of my app. After upgrading to OS X Lion (10.7) i no longer had ImageMagick available,…
rroche
  • 1,262
  • 1
  • 13
  • 29
70
votes
8 answers

Use ImageMagick to place an image inside a larger canvas

Getting started with ImageMagic and trying to find a way to do this... If an image is less than 50 pixels tall or 50 pixels wide, I'd like to place it (un-scaled) in the horizontal/vertical center of a new 50x50 pixel canvas on top of a white…
Mike
  • 821
  • 1
  • 9
  • 6
69
votes
4 answers

ImageMagick not authorized to convert PDF to an image

I have a program, in which I need to convert a PDF to an image using Image Magick. I do that using the subprocess package: cmd = 'magick convert -density 300 '+pdfFile+'['+str(rangeTuple[0])+'-'+str(rangeTuple[1])+'] -depth 8 '+'temp.tiff'…
Mooncrater
  • 4,146
  • 4
  • 33
  • 62
67
votes
2 answers

ImageMagick extend canvas with transparent background

convert input.png -extent 100x100 -gravity center -background white output.png If the input is 50x50 the surrounding background is white. Can I somehow set this to transparent without declaring any color within input as transparent?
Toby
  • 2,720
  • 5
  • 29
  • 46
66
votes
12 answers

ImageMagick / RMagick - Can't install RMagick 2.13.1. Can't find Magick-config

I used a script to install ImageMagick http://github.com/masterkain/ImageMagick-sl After a while, I got ImageMagick installed. Then I ran sudo gem install rmagick and got Building native extensions. This could take a while... ERROR: Error…
teecraft
  • 927
  • 2
  • 9
  • 10
66
votes
8 answers

Error installing Rmagick on Mountain Lion

I have seen other people with the same issue of installing RMagick on Mountain Lion However none of the suggested solutions have allowed me to successfully install rmagick. Here is the error message I am…
tomciopp
  • 2,602
  • 2
  • 31
  • 60
66
votes
5 answers

Trim whitespace using PIL

Is there a simple solution to trim whitespace on the image in PIL? ImageMagick has easy support for it in the following way: convert test.jpeg -fuzz 7% -trim test_trimmed.jpeg I found a solution for PIL: from PIL import Image, ImageChops def…
Eugene Nagorny
  • 1,626
  • 3
  • 18
  • 32
65
votes
5 answers

ImageMagick: convert image to PDF with A4 page size and image fit to page

I want to convert different image formats (bmp,jpg,gif,png,tiff-incluging multipaged) into a PDF format with A4 page size and with images fit to page (resized if necessary). Image should be positioned at the center of the page and I'd like to define…
Mariusz Pala
  • 961
  • 1
  • 8
  • 17
65
votes
2 answers

How to extract frames from a GIF file preserving frame dimensions

I have the following GIF image file: I want to extract its frames (using PGM output format) using this imagemagick command: convert brocoli.gif out%05d.pgm But each frame has a different size. How can I extract its frames while preserving the…
Joe Cabezas
  • 1,397
  • 3
  • 15
  • 21