Strict Standards: Declaration of Doku_Renderer_metadata::table_open() should be compatible with Doku_Renderer::table_open($maxcols = NULL, $numrows = NULL, $pos = NULL) in /home/tinycore/wiki.tinycorelinux.net/inc/parser/metadata.php on line 24

Strict Standards: Declaration of Doku_Renderer_metadata::table_close() should be compatible with Doku_Renderer::table_close($pos = NULL) in /home/tinycore/wiki.tinycorelinux.net/inc/parser/metadata.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home/tinycore/wiki.tinycorelinux.net/inc/parser/metadata.php:24) in /home/tinycore/wiki.tinycorelinux.net/inc/actions.php on line 180
wiki:imagemagick - Tiny Core Linux Wiki

Welcome to the Tiny Core Linux Wiki at tinycorelinux.net!

Image Magick

Imagemagick is a very powerful program for altering and refining graphical images using simple text commands. While the program is not small (at about 2GB), it is still far more compact than alternatives such as GIMP. When combined with something like Xnview (often run through WINE), Imagemagick can serve as a Linux alternative to GIMP or Photoshop (in Windows).

The text that follows is quoted with some modification from the following web page:

http://www.perturb.org/display/ImageMagick_resize_images.html

ImageMagick has some pretty cool commandline tools to manage images. Specifically, it can help you resize an image (make it smaller).

You don't need any complicated shell script to batch convert a whole directory of images - because ImageMagick's “convert” and “mogrify” commands support wildcards. (Aside: “convert” replaces existing files, “mogrify” allows you to specify an output file.)

Here's an example of a single command that will create JPEG images at no larger than 800×600, setting the quality to 75 (pretty good). Notice the ”-strip” option: This takes out JPEG's EXIF header data - which even in a small JPEG file can be 20,000 bytes of data! So it's a great idea to include this for web images, if you don't need all that EXIF data (and if you're like me, you probably didn't even know it existed, so you won't miss it right?)

First, place COPIES of all the photos you want to resize in /tmp and change to that directory in a terminal shell. Then use the following command:

sudo mogrify -format jpg -quality 75 -resize "800x600>" -strip * <Enter>

The wildcard “*” at the end means: Do all the files you find in this directory.

Other ways to do the same sort of thing–

For a single image:

convert -resize 50% -quality 80 input.jpg output.jpg

For a directory, go to /tmp and “mkdir photos” as well as “mkdir output.” Put copies of the images to be resized in /tmp/photos. “cd” into /tmp/photos and issue one of the following commands:

sudo find . -name "*.jpg" -exec convert -quality 75 {} /tmp/output/{} \; <Enter>
sudo find . -name "*.jpg" -exec convert -resize 50% {} /tmp/output/{} \; <Enter>
sudo find . -name "*.jpg" -exec convert -resize 800x600 {} /tmp/output/{} \; <Enter>

More extensive help in using Imagemagick is available at

http://www.imagemagick.org/Usage/

Print/export