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

8404 questions
69
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 store the image as a BLOB; for example: $image = new…
Googlebot
  • 13,096
  • 38
  • 113
  • 210
67
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,670
  • 5
  • 24
  • 45
66
votes
3 answers

Convert HEIF (.heic) to JPEG on a server?

Apple has introduced a new image format in iOS 11 called HEIF (.heic file extension). I know you can export images as JPG from iOS devices, but I want to upload the HEIC-files to my server and convert them there to JPEG files that can be shown on…
Christian
  • 852
  • 1
  • 8
  • 13
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,352
  • 1
  • 27
  • 57
65
votes
10 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,178
  • 2
  • 21
  • 28
63
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. So I add a new style in my Photo model and all…
tybro0103
  • 43,805
  • 32
  • 138
  • 167
63
votes
7 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,097
  • 5
  • 28
  • 52
60
votes
7 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
  • 721
  • 1
  • 8
  • 6
60
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,491
  • 5
  • 26
  • 44
58
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,178
  • 3
  • 13
  • 18
57
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 looking to do basic image manipulation in C++…
QbProg
  • 1,350
  • 1
  • 10
  • 17
56
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,361
  • 5
  • 18
  • 41
55
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 updated since 2009. The only thing I have been…
bsktball11ch
  • 683
  • 1
  • 6
  • 6
55
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
  • 2,587
  • 3
  • 20
  • 46