Questions tagged [imagemagick]

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

Filter by
Sorted by
Tagged with
773 votes
14 answers

ImageMagick security policy 'PDF' blocking conversion

The Imagemagick security policy seems to be not allowing me perform this conversion from pdf to png. Converting other extensions seem to be working, just not from pdf. I haven't changed any of the ...
T. Zack Crawford's user avatar
580 votes
20 answers

How to convert a SVG to a PNG with ImageMagick?

I have a SVG file that has a defined size of 16x16. When I use ImageMagick's convert program to convert it into a PNG, then I get a 16x16 pixel PNG which is way too small: convert test.svg test.png ...
kayahr's user avatar
  • 21k
416 votes
24 answers

Convert PDF to image with high resolution

I'm trying to use the command line program convert to take a PDF into an image (JPEG or PNG). Here is one of the PDFs that I'm trying to convert. I want the program to trim off the excess white-...
JBWhitmore's user avatar
  • 11.6k
398 votes
17 answers

Replace transparency in PNG image with white background

I have a PNG image with an alpha channel (i.e. transparency), and I need to create versions with the image layer composed onto a white background. I want to use a scriptable command using a CLI tool ...
Pointy's user avatar
  • 406k
351 votes
11 answers

convert:not authorized `aaaa` @ error/constitute.c/ReadImage/453

I want to create a captcha pic by use convert from ImageMagick. And I follow this, but there are some problem . Input In my linux shell: convert -background white -fill black -font FreeSerif-Bold -...
jianwei's user avatar
  • 3,561
329 votes
11 answers

Recommendation for compressing JPG files with ImageMagick

I want to compress a JPG image file with ImageMagick but can't get much difference in size. By default the output size is bigger than the input. I don't know why, but after adding some +profile ...
Javis Perez's user avatar
  • 4,150
241 votes
25 answers

rmagick gem install "Can't find Magick-config"

I get the error shown below when attempting to install the rmagick gem. I am on Snowleopard 10.6 using RVM, Ruby 1.9.2-head and Rails 3.05. Responses to similar questions recommended installing ...
Joe's user avatar
  • 3,362
215 votes
3 answers

“Diff” an image using ImageMagick

How can I get the difference between two images? I have the original image. Someone has written on an exact duplicate of the original image. Now, I need to compare the original to the written on image ...
Justin Noel's user avatar
  • 5,945
188 votes
21 answers

RMagick installation: Can't find MagickWand.h

Updating RMagick and Imagemagick is a painful expierence. I have updated the Imagemagick version on my mac (MacOS El Capitan Version 10.11.5) with homebrew for one project in Ruby 2.3 to 6.9.5-9 $ ...
0x4a6f4672's user avatar
  • 27.4k
182 votes
10 answers

How to remove EXIF data without recompressing the JPEG? [closed]

I want to remove the EXIF information (including thumbnail, metadata, camera info... everything!) from JPEG files, but I don't want to recompress it, as recompressing the JPEG will degrade the quality,...
Denilson Sá Maia's user avatar
163 votes
8 answers

Set transparent background using ImageMagick and commandline prompt

Suppose you have any image (PNG or JPG). This image has a white background and I need to make this background transparent. I have tried with these examples: convert original.png -background none ...
Israel's user avatar
  • 3,262
151 votes
6 answers

Merge Images Side by Side (Horizontally)

I have five images of sizes: 600x30, 600x30, 600x30, 600x30, 810x30. Their names are: 0.png, 1.png, 2.png, 3.png, 4.png, respectively. How do I merge them Horizontally to make an image of size ...
Sasuke Kun's user avatar
  • 2,459
140 votes
15 answers

Ruby: Installing rmagick on Ubuntu

I'm trying to get RMagick setup on Ubuntu 10.04. Looked here but had no joy. I even compiled and installed ImageMagick from source, but the instructions here still didn't help me when I try to install ...
Ciaran Archer's user avatar
125 votes
9 answers

Convert SVG image to PNG with PHP

I'm working on a web project that involves a dynamically generated map of the US coloring different states based on a set of data. This SVG file gives me a good blank map of the US and is very easy ...
Mike B's user avatar
  • 2,670
121 votes
3 answers

Imagemagick: Convert to fixed width, proportional height

Using the imagemagick convert command, how can I resize an image to a fixed width and proportional height e.g. using the -resize or the -thumbnail option?
Christof Aenderl's user avatar
121 votes
4 answers

Convert PDF to PNG using ImageMagick

using ImageMagick, what command should i use to convert a PDF to PNG? I need highest quality, smallest file size. this is what I have so far (very slow by the way): convert -density 300 -depth 8 -...
StackOverflowNewbie's user avatar
111 votes
3 answers

Detect EXIF Orientation and Rotate Image using ImageMagick

Canon DSLRs appear to save photos in landscape orientation and uses exif::orientation to do the rotation. Question: How can imagemagick be used to re-save the image into the intended orientation ...
Nyxynyx's user avatar
  • 61.5k
104 votes
10 answers

Verify ImageMagick installation

My web hosting said ImageMagic has been pre-installed on the server. I did a quick search for "ImageMagick" in the output of phpinfo() and I found nothing. I can't SSH in the server so is there a way ...
Desmond Liang's user avatar
103 votes
5 answers

Batch resize images and output images to new folder with ImageMagick

Current image folder path: public_html/images/thumbs Output image folder path: public_html/images/new-thumbs I have 10 video thumbs per video in current folder, named of image thumbs: 1-1.jpg 1-2....
richard's user avatar
  • 1,456
96 votes
4 answers

cache resources exhausted Imagemagick

I'm using Imagemagick on a rails app with Minimagick and I generate some pictogram with it. When I launch my process I have this error and I don't find a solution: MiniMagick::Error (`convert -limit ...
Gregory Frerot's user avatar
96 votes
1 answer

What is the difference for sample/resample/scale/resize/adaptive-resize/thumbnail operators in ImageMagick convert?

I found multiple ways to change the resolution of an image using convert: -sample -resample -scale -resize -adaptive-resize -thumbnail What's the difference of those? If I need to make various size ...
est's user avatar
  • 11.5k
94 votes
2 answers

GD vs ImageMagick vs Gmagick for jpg? [closed]

I am in the step to abandon GD for manipulating image in my website - it is awful. Everyone saying to use ImageMagick because they are better than GD, but what about ImageMagick vs Gmagick (Swiss ...
dynamic's user avatar
  • 47.1k
93 votes
5 answers

Storing image in database directly or as base64 data?

The common method to store images in a database is to convert the image to base64 data before storing the data. This process will increase the size by 33%. Alternatively it is possible to directly ...
Googlebot's user avatar
  • 15.2k
92 votes
12 answers

Converting a PDF to PNG

I'm trying to convert a PDF to a PNG image (at least the cover of one). I'm successfully extracting the first page of the PDF with pdftk. I'm using imagemagick to do the conversion: convert cover.pdf ...
Adam's user avatar
  • 1,467
89 votes
6 answers

With ImageMagick, how can you see all available fonts?

ImageMagick can draw text into a picture in a given font, how can I see all available fonts for my system?
flybywire's user avatar
  • 262k
89 votes
2 answers

How do I modify a Homebrew formula?

I installed ImageMagick via Homebrew. However, due to a bug I have with my current configuration, I need to adjust the compile flags for the formula and reinstall it. How can I accomplish this?
maček's user avatar
  • 76.5k
85 votes
8 answers

Convert SVG to transparent PNG with antialiasing, using ImageMagick

I want to convert SVG images to PNG files with transparent background and anti-aliased edges (using semi-transparent pixels). Unfortunately I can't get ImageMagick to do the anti-aliasing, the edges ...
Andreas Gohr's user avatar
  • 4,637
85 votes
7 answers

What is the difference between ImageMagick and GraphicsMagick?

I've found myself evaluating both of these libs. Apart from what the GraphicsMagick comparison says, I see that ImageMagick still got updates and it seems that the two are almost identical. I'm just ...
QbProg's user avatar
  • 1,675
84 votes
3 answers

Converting GIF's, PNG's and JPG's to .ICO files using Imagemagick

From: JPG, To: ICO; /usr/bin/convert -resize x16 -gravity center -crop 16x16+0+0 input.jpg \ -transparent white -colors 256 output/favicon.ico This is the output for the command line. From: GIF's, ...
Chris Braid's user avatar
82 votes
4 answers

How do I crop an animated gif using ImageMagick?

There's plenty of information about cropping images, but attempting to crop (or trim) animations produces strange results. Sometimes they flicker, or come with extra frames, or some frames crop ...
jimmetry's user avatar
  • 2,141
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's user avatar
  • 3,338
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's user avatar
  • 1,832
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: but the desired method:...
egor7's user avatar
  • 4,678
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, ...
Agis's user avatar
  • 32.7k
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 `//' @ error/constitute.c/ReadImage/532. I'm ...
Trolley's user avatar
  • 2,338
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 ...
MatthewD's user avatar
  • 6,719
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 ...
rroche's user avatar
  • 1,262
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 ...
Mike's user avatar
  • 821
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(...
Mooncrater's user avatar
  • 4,216
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 ...
Toby's user avatar
  • 2,720
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 ...
tomciopp's user avatar
  • 2,602
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 After a while, I got ImageMagick installed. Then I ran sudo gem install rmagick and got Building native extensions....
teecraft's user avatar
  • 927
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 ...
Eugene Nagorny's user avatar
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 ...
Mariusz Pala's user avatar
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 ...
Joe Cabezas's user avatar
  • 1,397
64 votes
2 answers

Resize existing images to new style in paperclip & RMagick

I've been using paperclip to upload and auto-resize photos in my Rails app, and I love it. Only problem is about every other month my crazy manager decides he wants a new size to display the photos in....
tybro0103's user avatar
  • 48.4k
62 votes
3 answers

Can I access ImageMagick API with Python?

I need to use ImageMagick as PIL does not have the amount of image functionality available that I am looking for. However, I am wanting to use Python. The python bindings (PythonMagick) have not been ...
bsktball11ch's user avatar
61 votes
3 answers

ImageMagick PDF to JPGs sometimes results in black background

I have the following: ghostscript-fonts-5.50-24 ImageMagick-6.7.2-1 ghostscript-9.02-1 Which I use to create a series of JPGs for each page using: convert -density 175 -colorspace sRGB test.pdf -...
jahilldev's user avatar
  • 3,550
60 votes
3 answers

imagemagick: create a .png file which is just a solid rectangle

I want to create a .png file which is just a solid color. This must be easy to do using ImageMagick but I can't figure out the problem: C:\tmp>convert -size 8x16 -stroke black -fill black -draw "...
Jason S's user avatar
  • 185k
59 votes
5 answers

How do I control PDF paper size with ImageMagick?

I have 16 jpg files which are around 920x1200 pixels (the widths slightly differ but heights are all 1200). I'm trying to join them into a pdf with: convert *.jpg foo.pdf But the resulting paper ...
mackstann's user avatar
  • 1,297

2 3 4 5