Tag Archives: Imagemagick

Use Image Magick to batch convert .png files to .gif

I just checked, and W3Counter puts global Internet Explorer 6 usage at just 5.78%. This is a pretty good argument for not supporting it anymore with my websites, but I still do it. Maybe its just habit, or maybe its because I’ve become really fast at dealing with IE6 and its many deficiencies so its [...]

Posted in Solutions | Tagged | Leave a comment

Imagemagick: use montage to proof images

The following command will create an image called montage.png that is a collection of all the .png files in the current directory. Images larger than 150px on a side will be resized, but aspect ratio is preserved. The images are separated by a 2px offset. $ montage *.png -geometry 150×150\>+2+2 montage.png

Posted in Solutions | Tagged | Leave a comment

Tile images in Imagemagick to create CSS sprites

The Magick This will stack two images to create a CSS sprite. Very handy for flicker-free image rollovers: $ montage -background transparent -tile 1×2 -geometry +0+2 image1.gif image2.gif result.gif You could create a taller or wider stack by adjusting the -tile option. For example -tile 2×10 would stack 2 images across and 10 images down. [...]

Posted in Musings | Also tagged | 1 Comment

Image Magick: Resize a batch of images so they all come out square, and preserve filenames

The following command will shrink all .jpg’s in the current directory that are larger than 500px and center them on a square 500x500px canvas. Since the aspect ratio of the original images will be preserved and not all of the originals are square, the left over space will be filled with an off-white color. All [...]

Posted in Solutions | Tagged | Leave a comment

Image Magick: Resize a batch of images and preserve the original file names

The following command will resize any and all .jpg’s in the current directory that are larger than 500px on either side and put them in a file called ‘resized’. Aspect ratios will be respected, and the same filenames will be used for the modified images. mogrify -path resized -resize 500>x500\> *.jpg Yes, you have to [...]

Posted in Solutions | Tagged | Leave a comment