User Tools

Site Tools


imagemagick

ImageMagick

Usage

Screenshots

I use this script for taking screenshots, bound to the Print Scrn key with i3wm. It dumps a screenshot into my 'Pictures' directory, and makes a beep. You can set it to make a notification if you want.

screenshot.sh
#!/bin/bash
import -window root $HOME/Pictures/screenshot_`date +%y-%m-%d_%H-%M-%S`.png

Without beep:

screenshot.sh
#!/bin/bash
import -silent -window root $HOME/Pictures/screenshot_`date +%y-%m-%d_%H-%M-%S`.png

Image Conversion

Two main commands are convert and mogrify. The distinction is that the former makes new files, and the later can overwrite existing files.

This will convert all PNGs in the current directory to JPGs at quality 50 and scaled to 1200px width.

mogrify -format jpg -quality 50% -resize 1200x *.png

Create PDF

To create a PDF from a bunch of PNG files in a directory:

convert *.png [name].pdf

Guides

See Also

imagemagick.txt · Last modified: 2023/12/20 21:56 by rjt