Questions tagged [imagemagick]
ImageMagick is an open source software suite for displaying, converting and editing raster image files.
484
questions
259
votes
2
answers
230k
views
Vertically stack multiple images using ImageMagick
I would like to combine multiple images into one image using ImageMagick. To explain a little better, I want the result to look similar to this:
That is, I have a number of screenshots, and I want to ...
153
votes
2
answers
198k
views
How do you re-install a package with Homebrew (Mac)?
Struggling to find good Homebrew documentation (or tutorial)...
In the mean time I need to reinstall ImageMagick that was installed with Homebrew (brew install imagemagick) and not sure if I should ...
101
votes
5
answers
101k
views
How to install rmagick on Ubuntu 10.04?
Here's what I've done so far:
sudo apt-get install imagemagick libmagickcore-dev
This did not throw any errors, so I think that ImageMagick is installed fine. Then I tried installing the gem:
sudo ...
99
votes
3
answers
44k
views
Can't convert PDF into image, because of 'no images defined' error
I've the following PDF file:
http://www.fmwconcepts.com/misc_tests/pdf_tests/test.pdf
But when I'm trying to convert it via:
$ convert test.pdf test.png
I've the following error:
convert: no ...
91
votes
3
answers
60k
views
Invert colors with ImageMagick
How do I invert the colors of an image using the ImageMagick convert tool, so that black becomes white and white becomes black?
In other words, I want to turn this:
into this:
76
votes
3
answers
52k
views
Appending images vertically in ImageMagick
convert -append 1.jpg 2.jpg out.jpg
This command appends 1.jpg and 2.jpg horizontally. What is the command to do this vertically?
73
votes
4
answers
80k
views
How to crop an image using ImageMagick from the command line?
I am trying to crop a 640x640 image using ImageMagick on the command line.
I need to remove about 20 pixels from the bottom part of the image all the way from left to right. A long strip along the ...
65
votes
6
answers
87k
views
How to merge pdf:s using Imagemagick (resolution problem)
When I try to merge two .pdf files using Imagemagick
convert pdf1.pdf pdf2.pdf temp.pdf
the resulting temp.pdf file seems to have very low resolution. How can I keep the resolution same as in the ...
57
votes
5
answers
75k
views
I want to change DPI with ImageMagick without changing the actual byte-size of the image data
In GIMP there is a very simple way to do what I want. I only have the German dialog installed but I’ll try to translate it. I’m talking about going to Picture -> PrintingSize and then adjusting the ...
36
votes
8
answers
35k
views
Square thumbnails with ImageMagick (convert)?
How to create square/cropped thumbnail using ImageMagick ? Cropping like below.
34
votes
3
answers
23k
views
Why is the gif I created so slow?
I am using ImageMagick to turn a collection of pngs into a single gif. I want this gif to loop as quickly as possible.
This is approximately the output I expect (courtesy of Wikipedia):
This is the ...
30
votes
4
answers
45k
views
How to convert a photo to a black and white image by ImageMagick?
How can I convert a JPEG photo to black and white (not grayscale) image like output of a FAX scanner, by ImageMagick?
29
votes
2
answers
26k
views
Command line to automatically crop an image?
By using Gimp's menu, you can automatically crop the image (removing white borders). I have a lot of images with white borders of different sizes. I want to remove them using Gimp in command line but ...
29
votes
1
answer
12k
views
Stack images vertically and center
I have several images of different widths and heights that I would like to stack vertically about their respective centers.
I've tried
convert 1.jpg 2.jpg 3.jpg -append out.jpg
But this aligns them ...
27
votes
1
answer
59k
views
Convert PDF to JPG images with ImageMagick - how to 0-pad file names?
I convert a pdf file to jpg images by using ImageMagick like this:
convert -density 600 foo.pdf foo.jpg
The created jpg images are named foo-1.jpg, foo-10.jpg and so on.
Is there way to 0-pad the ...
24
votes
4
answers
21k
views
How to insert white space with imagemagick?
What parameters does "convert" (?) need to get this OUTPUT from this INPUT?
INPUT:
OUTPUT:
23
votes
3
answers
11k
views
Error in converting a PDF to a PNG in ImageMagick
I use Imagemagick convert to convert pdf file to png as follows:
Magick convert -density 300 PointOnLine.pdf -quality 90 PointOnLine.png
It gives warning:
convert: profile 'icc': 'RGB ': RGB color ...
23
votes
1
answer
12k
views
How do I resize and pad an image to a given size using imagemagick?
Say I have a directory of images which is variously 3024×4032 and 4032×3024 pixels, and I want them all resized to 1920×1080.
I want that exact output size, but I don't want the images distorted to ...
22
votes
2
answers
8k
views
Convert HTML to image
Background
Batch convert various syntax-highlighted source files (C, SQL, Java, PHP, batch, bash) into high-resolution images (600dpi), suitable for an eBook and printed book.
Failed Solutions
A ...
20
votes
4
answers
15k
views
How can I tell if my image is CMYK from Linux command line?
I'm converting images from RGB to CMYK. How can I tell if my image is CMYK from the Linux command line?
20
votes
1
answer
10k
views
ImageMagick: convert quits after some pages
I try to convert some jpgs into one single pdf in using convert.
convert *.jpg new.pdf
But convert does quit after 18 pages. The output then is ok but not complete.
convert-im6.q16: ...
19
votes
3
answers
79k
views
Command Line loop to run command on all files in a directory (plus sub directories, if possible
I'm assuming this is fairly easy to do, but I have zero experience with Windows's command line utilities. Basically, I need to iterate over all files in a directory (great if it can do sub-directories,...
18
votes
2
answers
27k
views
Using Ghostscript to convert multi-page PDF into single JPG?
I know Ghostscript can convert PDFs to JPGs, and in the case of a multi-page PDF, can rip each page to an individual JPG. But is it possible to have it rip them to one JPG, so that the pages are ...
18
votes
3
answers
8k
views
Convert grayscale image into alpha channel image in unix shell
I have a gray-scale image. I want to convert it into an transparent PNG, such that the black pixels (in the original image) become fully opaque, the white pixels become fully transparent, a 50% grey ...
17
votes
1
answer
14k
views
Use imagemagic to put several JPG on one page
I have a folder full of jpg files. When I use the following command,
convert *.jpg assembly.pdf
I get a pdf file with one image per page of the pdf. I would like to put 9 images on each page. Is ...
16
votes
11
answers
28k
views
I have compiled ImageMagick on my CentOS, and RMagick won't install
I installed ImageMagick through, (Using ImageMagick 6.7.3-7)
./configure --prefix=/usr && make && make install
When I try to
gem install imagemagick
I get
Building native ...
16
votes
2
answers
17k
views
How can I deskew and crop PDFs made from scanned pages *automatically*? [duplicate]
Possible Duplicate:
Which free software can I use to deskew scanned images
I have several PDFs made up of book pages' scans. The scans are made from two pages at a time and some of these scans ...
15
votes
2
answers
23k
views
Can ImageMagick make thumbnails from video?
I'm trying to extract thumbnails from video via ImageMagick. I found some samples from their official site, but it makes GIF, not PNG. I want a solid thumbnail though.
Can it create the same output ...
13
votes
1
answer
10k
views
How to auto-trim scanned images using imagemagick or graphicsmagick?
I've got some scanned images in *.jpg format. They are scanned using A4 scanner, in greyscale or colour. Scanned pages have very different dimensions - some A5, some A6, some business cards etc. ...
12
votes
1
answer
20k
views
Converting from color to true black and white in ImageMagick? [duplicate]
I have seen how to convert a picture from color to grayscale in this Super User question and answer thread. However, grayscale is not black and white.
Simply put, if a field has color, I want to ...
12
votes
4
answers
15k
views
Merge two pdf files side by side in command line
I have got two pdf files with same number of pages and want compare each page with the corresponding page in the other file. For this I would like to merge say page 1 of File1.pdf with page 1 of File2....
12
votes
1
answer
6k
views
Get crisp, clear thumbnails from MP4 with FFmpeg / ImageMagick
My ultimate goal is to get meaningful snapshots from videos that are either 30 min or 1 hour long. "Meaningful" is a bit ambitious, so I have simplified my requirements.
The image should be crisp - ...
11
votes
4
answers
9k
views
ImageMagick Convert: How to produce sharp resized PNG files from SVG files?
I am using this command to generate a sharp 512px wide version of an SVG file that I have:
convert -geometry 256 pinterest.svg pinterest.png
This is the source file:
<?xml version="1.0" encoding=...
10
votes
7
answers
25k
views
Sort and rename images by date in EXIF info
I have a mess in my photos folder; I want to sort them according to date in EXIF information and rename according to the date (like 001.jpg, 002.jpg and so on).
How can I do this in Linux? I have ...
10
votes
3
answers
14k
views
How do I change the canvas size of a PNG with ImageMagick (GraphicsMagick)? (How to pad with transparency?)
Alternatively: How do I take a non-square PNG and "fill out" the "rest" of the image with transparency so that the resulting square image has the original image centered in the square?
ULTIMATELY, ...
10
votes
4
answers
3k
views
How to resize an animated webp?
I want to be able to change the size of a dynamic webp.
Sample picture. I found this website to do just that.
So how can I implement something similar in my own program?
I tried using ImageMagick7 or ...
10
votes
1
answer
9k
views
ImageMagick mogrify does not overwrite original files
I would like to convert image formats.
I can use 'convert' command, but it made another image.
So I searched and find 'mogrify' command in ImageMagick official page.
What I did was
mogrify -...
10
votes
3
answers
1k
views
How do I use ImageMagick convert in a reproducible manner (without timestamps)?
I am trying to use ImageMagick in a script to convert and resize a large number of files for version control. I need the files to convert the same time every time so git won't commit files that just ...
10
votes
1
answer
3k
views
Tile animated gifs
Is there some way to use imagemagic / montage to tile looped animated gifs (intermixed with nonanimated ones)?
That is, I want to concatenate the animations in space, not in time. I realize that the ...
9
votes
2
answers
6k
views
How can I convert animated gif to animated webp?
On ubunt, I can convert animated .gif files to .webp format using imagemagick's convert 1.gif 1.webp, but then the animation is lost in the destination .web.
I'm wondering how to preserver the ...
9
votes
4
answers
12k
views
Creating and splitting large multipage TIFF images
I need to both create and split multipage TIFF images, ranging from 2 to almost 100 pages (A4, 300 dpi, 2500×3500 px). The job is performed periodically by a script on an x64 Linux server. Currently I'...
9
votes
1
answer
5k
views
append images using a grid
convert +append ...
appends images horizontally.
convert -append ...
appends images vertically.
Imagine i have a set of N images and i want to create to append the images following a grid of N/2 ...
9
votes
4
answers
7k
views
How to convert DICOM images to PNG?
I have some DICOM medical imaging files downloaded from Cancer Imaging Archive. I can convert them from DICOM to several other formats, but as you'll see the conversion isn't working as expected in ...
8
votes
2
answers
8k
views
How to stretch an image in one dimension?
The title says much, but I'll explain in detail a little more.
I need to stretch an image in one dimension only. That is, if the image is for example, 100x100 (Width x Height) I need it to be 100x104 ...
8
votes
1
answer
935
views
How to create PocketBook-compatible BMP files using ImageMagick?
PocketBook 611 is a black-and-white e-book reader. PocketBook 611 (and models of similar age, before touch displays were introduced) uses a very specific BMP format for its so-called "Power-off ...
8
votes
1
answer
4k
views
Can ImageMagick number output files with two digits?
I use the following command to extract pages from PDF files into independent JPG files before inserting them into videos:
convert.exe -density 96 -resize 640x480 input.pdf +adjoin -alpha remove -...
8
votes
1
answer
11k
views
Merge two images with transparency in imagemagick
I have two images without transparency (two photos) and I want to combine these images into one image where first image covers second image. How to scale these images to the same size and merge with ...
8
votes
2
answers
11k
views
How to replace colors (shape color and background color)?
I want to change the white background to #3D94DB (Hex triplet notation) and change the black lines to white. The image is as following:
Here is what I have achieved:
convert input.png +level-colors ...
8
votes
4
answers
14k
views
Bulk convert PNG-24 to PNG-8 files with best quality
Can anybody recommend a good method of bulk converting a large amount of PNG-24 files to PNG-8 with as little loss of quality as possible and maintaining transparency?
I've tried ImageMagick but the ...
8
votes
3
answers
12k
views
Using GraphicsMagick or ImageMagick, how do I replace transparency with a fill colour?
Using GraphicsMagick, it's fairly easy to replace one colour with transparency...
gm convert -transparent magenta src.png dst.png
Unfortunately, I can't figure out a simple way to do the exact ...