If you want the command-line option, go with
sudo apt-get install imagemagick
Most operations will use the
convert command. To convert an image into another format, you essentially rename your image with the desired file extension.
convert image1.png image1.jpg
To resize images, use the
convert image1.png -resize 200×100 image1.png
Note that when using
-resize, ImageMagick will preserve the image's aspect ratio and fit it into an image with the specified dimensions. To force an image to a particular size, append an
! to the dimensions.
convert image1.png -resize 200×100! image1.png
Rotate images with the
-rotate option, using degrees. The following command would rotate an image 90 degrees.
convert image1.jpg -rotate 90 image1-rotated.jpg
Since this is a command-line tool, you can take advantage of Bash and perform bulk operations. The following command would take all PNG files in the current directory, rotate them, and save a new copy of each with “-rotated” added to the beginning of each file name.
for file in *.png; do convert $file -rotate 90 rotated-$file; done
During any given operation, if the name of your output image is the same as the input image, the operation will overwrite the original image. Otherwise a new image will be created.
You can find more complete documentation here on the ImageMagick website.
- Convert an entire PDF file to a bunch images
- Extract an image from a Windows .ico file
I am unsure if these operations are possible.
- Convert images to DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, TIFF, and other formats
I am unsure if all those file formats are supported by ImageMagick