The "convert" command, from the ImageMagick® software suite is a program to convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.
Questions tagged [imagemagick-convert]
1387 questions
5
votes
3 answers
Detect if image is grayscale or color using Imagick
I'm attempting to try and assign a value to an image based on its 'saturation level', to see if the image is black and white or color. I'm using Imagick, and have found what seems to be the perfect code for the command line and am trying to…

dvyio
- 339
- 1
- 7
- 20
5
votes
3 answers
imagemagick wand save pdf pages as images
I would like to use imagemagick Wand package to convert all pages of a pdf file into a single image file. I am having the following trouble though (see comments below which highlight problem)
import tempfile
from wand.image import Image
with…

Rich Tier
- 9,021
- 10
- 48
- 71
5
votes
4 answers
Multifile favicon.ico much bigger than sum of sizes of component files
I want to create multifile favicon.ico according to great favicon cheat sheet.
I created 3 .png files, optimized them with OptiPNG and received files with 1, 2 and 3kb size.
Now I'm trying to create favicon.ico from them using Imagemagick but final…

Banciur
- 75
- 6
5
votes
3 answers
How to -draw text and -shadow it in ImageMagick?
I'm printing some text on an image with convert and I would like to decorate the text with a black shadow, I tried -blur or -gaussian but I cannot apply to the text, it is applied to the background image only.
I need to use -draw command and not…

axel
- 3,778
- 4
- 45
- 72
5
votes
2 answers
How to manage image placement when converting to pdf with imagemagick?
I have a bunch of png's ripped from github, that look kind of like this:
All have a width of 912, but the heights vary.
I'm trying to convert them all to a nice readable A4 pdf, using:
convert -page A4 *.png -format pdf file.pdf
I can get them all…

Justin Aiken
- 745
- 7
- 10
5
votes
1 answer
Rotation Mapping in ImageMagick
Is there a way to rotate an image based upon a mapping in ImageMagick?
The problem is similar to displacement mapping however instead of warping & morphing the shape based upon the luma/chroma in a map I want to rotate an image based upon the…

Alex
- 3,732
- 5
- 37
- 59
5
votes
1 answer
convert a directory of images into a single PDF
I have a directory of images:
path/to/directory/
image01.jpg
image02.jpg
...
and would like to convert it into a single PDF file:
path/to/directory.pdf
This is what I managed to code so far:
#!/bin/bash
echo Directory $1
out=$(echo $1 |…

nobody2100
- 161
- 1
- 7
5
votes
1 answer
ImageMagick pdf to black and white pdf
I would like to convert a pdf file to a Black and White PDF file with ImageMagick. But I've got two problems:
I use this command:
convert -colorspace Gray D:\in.pdf D:\out.pdf
But this command convert only the FIRST page... How to convert all…

szuniverse
- 1,076
- 4
- 17
- 32
5
votes
3 answers
Batch crop and resize images to create thumbnails
I have a large set of jpg images for which I want to create thumbnails. The images all have different sizes and resolutions, but I would like all thumbnails to have a standard size, e.g. 120x80px. However, I do not want to stretch the images. So I…

Jeroen Ooms
- 31,998
- 35
- 134
- 207
5
votes
3 answers
Generate images with ImageMagick without saving to file but still display them on website
This is my ImageMagick code which works fine on my webserver by creating new image with the file name 'coloured_font.png' in a default directory ...
user1178070
4
votes
2 answers
Use ImageMagick to Generate Image from Text?
I'm trying to use ImageMagick to create thumbnail images that are 3840 x 2160.
I need the image to have a black background and white text. The text should be centered vertically and horizontally.
I want to be able to set a font size, but if the…

ShadowAccount
- 171
- 2
- 7
4
votes
1 answer
How to convert PNG images (specifically grayscale ones) to Indexed color
I'm trying to convert some small PNG images from 32-bit color mode to indexed color mode.
For color images, I ran the command convert IMGS/FLAME.png INDEXED_IMGS/FLAME.png and it converted fine. For an image that had only grayscale colors, I ran…

rcplusplus
- 2,767
- 5
- 29
- 43
4
votes
0 answers
Imagemagick convert failing in Firebase cloud function Spawn Child Process
I'm trying to crop images to aspect ratio 12:19 after they are uploaded to Firebase Storage using a Cloud Function that listens for new file uploads.
The ImageMagic's 'convert' command works locally. However, the 'spawned' process of the cloud…

leanGuardia
- 81
- 6
4
votes
3 answers
imagemagick: how to use the %[fx:...] operator in draw rectangle command?
I can do this to draw a red rectangle on an image:
convert original.png -fill red -draw "rectangle 10,20 150,40" result.png
The 150,40 is the right bottom coordinate. However if I use the %[fx:...] operator in there, like so:
convert original.png…

RocketNuts
- 9,958
- 11
- 47
- 88
4
votes
1 answer
Using parallel and Imagemagick to convert images to gif
I have used a python script which generates plots using a data file. Now because of huge amount of data, I am getting images in the range of 5000 and using ImageMagick's convert on a sequential processing is taking a lot of time.
I referred to this…

Vishwesh
- 108
- 2
- 9