Questions tagged [imagemagick]

ImageMagick is an open source image editing software suite for displaying, converting, and editing raster image files. It supports read/write for more than 100 image file formats.

Filter by
Sorted by
Tagged with
109
votes
7answers
176k views

Creating a GIF animation from PNG files

Is there a tool to create a gif animation from a set of png files? I tried the convert command from the ImageMagick suite, but this doesn't always succeed. Also, I have several issues with this: I ...
58
votes
10answers
144k views

How to convert TXT to PDF?

I want to convert .txt files to .pdf. I'm using this: ls | while read ONELINE; do convert -density 400 "$ONELINE" "$(echo "$ONELINE" | sed 's/.txt/.pdf/g')"; done But this produces one "error" -- ...
21
votes
7answers
34k views

How to rotate all images in a directory with imagemagick?

I want to rotate all the images in a directory that match a pattern. So far I have: for file in `ls /tmp/p/DSC*.JPG`; do convert $file -rotate 90 file+'_rotated'.JPG done but that gives no output?...
12
votes
1answer
3k views

Omitting extension with find?

I need to create thumbnails from multiple .png files and would like to do this using ImageMagicks convert utility. To recursively find all files that are not thumbnails themselves, I am using the ...
65
votes
6answers
126k views

pdf to jpg without quality loss; gscan2pdf

When I convert a pdf file to bunch of jpg files using convert -quality 100 file.pdf page_%04d.jpg I have appreciable quality loss. However if I do the following, there is no (noticeable) quality ...
58
votes
9answers
82k views

convert images to pdf: How to make PDF Pages same size

I did something like convert -page A4 -compress A4 *.png CH00.pdf But the 1st page is much larger than the subsequent pages. This happens even though the image dimensions are similar. These images ...
35
votes
4answers
30k views

How to split an image vertically using the command line?

Say I have a large 800x5000 image; how would I split that into 5 separate images with dimensions 800x1000 using the command line?
32
votes
3answers
31k views

How to rotate a set of pictures from the command line?

I have a large set of JPEG pictures all with the same resolution. It would take too long to open each one inside the graphical interface of imagemagic or gimp. How do I achieve each picture being ...
19
votes
3answers
18k views

Set default pdf reader

When I install shutter to take screenshots, imagemagick sets itself as default PDF-reader and I am unable to change it. I would like to have evince as default PDF-reader. I have tried right click ...
11
votes
4answers
5k views

Extract even-numbered and odd-numbered pages of a PDF into two separate PDFs

I have a PDF that consists of several hundred pages of bilingual text. Since I need to use OCR on each language separately, I want to grab the even and odd pages and make two separate PDFs, using ...
62
votes
13answers
133k views

Converting multiple image files from JPEG to PDF format

I want to convert some files from jpeg to pdf. I am using following command. $ convert image1.jpg image1.pdf But I have 100 images. How should I convert all of them to corresponding pdfs? I tried ...
24
votes
6answers
44k views

How to convert a color pdf to black-white?

I'd like to transform a pdf with some coloured text and images in another pdf with only black&white, in order to reduce its dimensions. Moreover, I would like to keep the text as text, without ...
21
votes
4answers
28k views

Convert every pdf in the current directory to png

I want to write a bash script to convert every .pdf file in the current directory into a .png file. For example: $ls . a.pdf b.pdf $./pdf2png.sh Converting pdfs to pngs a.pdf -> a.png b.pdf -> ...
16
votes
2answers
3k views

How to cut image by top 30% in Unix?

I want to cut 30% from the top of the image. I know the thread How to cut a really large raster image into smaller chunks? but there is no successful approach because I cannot find a distance measure ...
8
votes
1answer
8k views

ImageMagick (or other) for UTF-8 text to image

I'm trying to create many single-character images using convert. The purpose is to provide a plastics specialist with images to print onto keyboard keycaps. The ImageMagick documentation suggests ...
9
votes
1answer
17k views

How to convert, resize and center image with ImageMagick

I'm unable to center a converted *.png file with ImageMagick's gravity option. Gravity seems to have no effect in the following command. On the contrary it erases everything and the output becomes ...
9
votes
4answers
8k views

How to mount a .jpg centered into a .pdf (using defined page size and borders)?

I'm looking to convert a .jpg into a .pdf, so that the .jpg is positioned at a certain location: centered on (say) an A4 page, with a minimum border of 30 pixels all around between image and page ...
4
votes
3answers
3k views

ZSH: Stripping path, filename and extension from a list of files for piping a command

The syntax for the command convert in ImageMagick is convert source_filename.ext1 destination_filename.ext2 I would like to use zsh to feed it with files in a folder path_to_source and output the ...
3
votes
1answer
1k views

Crop and resize image to fit a5 pdf

I have an image (png, size 4288x2848) that I want to fit in a landscape a5 pdf with a 1cm border. I know I can do it with ImageMagick but don't know how.
2
votes
0answers
142 views

How to cut a really large raster image into smaller chunks?

I have a large poster as a pdf-file. I need to create a raster image from it (for instance because there seems to be no pdf viewer which allows me to zoom sufficiently to see the contents). So I ...
7
votes
2answers
1k views

Ways to convert and combine image files into a pdf file?

I have about 190 image files (png and jpg) in a directory. For more information, each image has 2500 x 3072 pixels, and about 500KB. I use the command convert from ImageMagik to convert and combine ...
5
votes
4answers
3k views

terminal transparency, Imagemagick, and X11 root window problem

In Ubuntu Natty and in Fedora 12, I have urxvt (with 256 colours), and use ImageMagick (display -window root [...]) to set the root window to a picture. When I use the transparency (-tr) option on ...
1
vote
2answers
3k views

ImageMagick/GraphicsMagick: How to merge/composite multiple (3+) images without temp files in a single step?

I am trying to create multiple (two or more) small images with different texts/fonts/sizes and then overlay them over a single source image on different positions in a single step (without creating ...
5
votes
1answer
2k views

Force GraphicsMagick to resize image to specific width

I'm batch processing a folder of image to a uniform width with GraphicsMagick (though I assume the same would apply to ImageMagick): $ gm convert -resize 1000x in.jpg out.jpg But when I inspect some ...
4
votes
2answers
2k views

Can I select a region for the screenshot via keyboard in import

Can I select a region for the screenshot via keyboard in import from ImageMagick? If yes, how can I do it? If no, what can I use instead of import?
3
votes
2answers
922 views

Oneliner for slicing an image?

I'm looking for a oneliner command that would slice an image into given proportions. Say input would be filename and slice dimensions. Are there any standard command-line tools for this? I tried ...
2
votes
2answers
5k views

Convert a lot of .tif files using imagemagick's mogrify command

I have a lot of tif images in a directory. So I try to convert them into jpg format. I use this command : mogrify -format jpg *.tif But I get an error... an error for each image in fact: mogrify: ...
2
votes
1answer
528 views

Border with ImageMagick

In Crop and resize image to fit a5 pdf I asked how to fit an image in a landscape A5. Now I'd like to add a border or frame for the image and a tagline in the bottom (between the bottom line and the ...
1
vote
1answer
108 views

ImageMagick -gravity: portrait-photo frame-of-reference rotated +90

Context iPhone photos of both: portrait & landscape to be time-stamped with EXIF data, via ImageMagick 7.0.10-62 Q16 x86_64 2021-02-07 + Catalina MacOs. ImageMagick installed via:brew install ...
1
vote
3answers
1k views

Multiple images on root window with ImageMagick

I don't run a desktop environment, but instead use a bare window manager (StumpWM). Thus, my usual method for setting a desktop background is to run display -window root <image file> from a WM ...
1
vote
3answers
778 views

imagemagick display: different text in font preview

The awesome display command from imagemagick allows me to preview fonts: display ~/.fonts/font.ttf However, the text is always the same ('That which does not destroy me, only makes me stronger'). Is ...
1
vote
1answer
342 views

Imagemagic convert renders only some utf-8 symbols

Imagemagic's convert util (render simple label feature) renders only some of utf-8 symbols. Here is example: convert -background white -fill black \ -density 600x600 -size 1346x756 -font DejaVu-...
-3
votes
1answer
139 views

Writing a script which converts and use xload

I am using ImageMagick. I am trying to write a script which launch 'n' convert runs. 'n' is the number given by user. The script must wait for all 'n' background/concurrent processes to complete ...