Resizing and Customizing Images
Let’s say that I want to downsize my image to 1000x1000 pixels. I would do it like this:
[donnie@fedora script_test]$ convert -resize 1000x1000 S1180001.jpg S1180001_small.jpg
[donnie@fedora script_test]$
By default, the convert
command maintains the original aspect ratio of the image. So, the size of my downsized image is actually 1000x563 pixels, as you see here:
[donnie@fedora script_test]$ identify S1180001_small.jpg
S1180001_small.jpg JPEG 1000x563 1000x563+0+0 8-bit sRGB 328914B 0.000u 0:00.000
[donnie@fedora script_test]$
Instead of specifying the size by pixels, you can specify the desired size in terms of a percentage of the original size, like so:
[donnie@fedora script_test]$ convert -resize 20% S1180001.jpg S1180001_small2.jpg
[donnie@fedora script_test]$
Now when I display the image, it will actually fit on my computer screen. Here’s how it looks:
Figure 13.4: Goldie, sleeping in my bedroom...