Questions tagged [imagemagick]

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

imagemagick
Filter by
Sorted by
Tagged with
818 votes
15 answers
396k views

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
596 votes
20 answers
351k views

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
  • 21.4k
430 votes
24 answers
486k views

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.9k
409 votes
17 answers
260k views

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
  • 410k
351 votes
11 answers
154k views

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
340 votes
11 answers
238k views

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,280
241 votes
25 answers
148k views

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,382
224 votes
3 answers
105k views

“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
  • 6,085
188 votes
21 answers
53k views

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.8k
186 votes
10 answers
127k views

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
168 votes
8 answers
171k views

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,322
155 votes
6 answers
85k views

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,509
141 votes
15 answers
88k views

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
178k views

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
124 votes
3 answers
68k views

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
123 votes
4 answers
168k views

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
113 votes
3 answers
56k views

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
  • 62.5k
109 votes
10 answers
158k views

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
107 votes
4 answers
117k views

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,496
104 votes
4 answers
61k views

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
97 votes
1 answer
38k views

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.6k
94 votes
5 answers
266k views

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.4k
94 votes
2 answers
48k views

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.5k
93 votes
12 answers
136k views

How to convert a PDF to PNG with ImageMagick "convert" or Ghostscript?

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,477
92 votes
7 answers
43k views

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,755
92 votes
2 answers
57k views

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
  • 77.1k
90 votes
6 answers
45k views

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
  • 267k
88 votes
3 answers
50k views

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
87 votes
8 answers
61k views

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,815
84 votes
4 answers
28k views

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,169
81 votes
4 answers
34k views

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
  • 1,916
80 votes
8 answers
90k views

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:...
egor7's user avatar
  • 4,824
78 votes
2 answers
44k views

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
13 answers
132k views

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 ...
Trolley's user avatar
  • 2,378
74 votes
3 answers
21k views

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
  • 33.1k
73 votes
8 answers
44k views

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
  • 851
72 votes
4 answers
57k views

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,494
72 votes
5 answers
74k views

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,739
71 votes
13 answers
54k views

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
69 votes
5 answers
77k views

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
  • 1,001
68 votes
5 answers
50k views

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
68 votes
2 answers
28k views

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 ...
Tobi's user avatar
  • 2,800
67 votes
2 answers
36k views

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,437
66 votes
8 answers
22k views

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,642
66 votes
12 answers
44k views

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....
teecraft's user avatar
  • 927
65 votes
3 answers
36k views

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,702
64 votes
2 answers
16k views

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
  • 49k
63 votes
3 answers
27k views

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
  • 187k
62 votes
3 answers
69k views

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
62 votes
5 answers
38k views

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,327

1
2 3 4 5
186