Skip Navigation

Building ImageMagick

I was successful building ImageMagick, but only after about eleventy-seven tries. After building the latest version (5.5.7) without any problems, I was somewhat surprised to discover that I was unable to work with JPEGs, because JPEG support is not built in. I got the source for the JPEG library libjpeg-6B (from the Independent JPEG Group) and built that a few hundred times. Either I put it in the wrong place or made some other blunder, because after each rebuild of ImageMagick, JPEG support was still denied me. I finally found a set of directions by “mud” that worked fine. Still working out the reasons why...

With ImageMagick working, I experimented with various settings and finally settled on this:

 

for img in "$1"/*[!T].jpg
do
   file=`basename "$img" .jpg`
   convert -filter Mitchell -resize 190x190 +profile "*" -quality 75 -unsharp 0x1.0+0.7+0.05 "$img" "${1}/${file}T.jpg"
done

 

What this does is call ImageMagick’s convert command using the Mitchell filter. It strips any embedded profiles to save space and adds a little unsharp masking for that extra sparkle. I wanted the thumbnails to be 190 pixels on their long dimension regardless of their orientation, and specifying 190 for both width and height does that. For the results, please feel free to visit the Photography section and look for thumbnails that are 190 pixels (not all are yet).