Resize Album Art

I use this to scale and crop my higher quality album art for embedding in my audio tags.

# Scale and crop album art for embedding in music tags

if [ -z $1 ]
		echo "Usage: `basename $0` image_file"
	convert $1 -resize 300x300^ -gravity center -extent 300x300 folder.jpg

One Response to Resize Album Art

  1. Curran says:

    This script is useful if you use Rockbox on older devices (such as the 3rd gen iPod). It resizes album art (named “cover.jpg”) and reduces the color to 4 shades of gray.

    convert cover.jpg -resize 64x64! -colorspace Gray -colors 4 /tmp/TMPcoverIN.xpm
    echo "/* XPM */
    static char *covernd_[] = {
    /* columns rows colors chars-per-pixel */
    \"64 64 4 1\",
    \"  c #000000\",
    \". c #555555\",
    \"X c #AAAAAA\",
    \"o c #FFFFFF\"," > /tmp/TMPcoverOUT.xpm
    tail -n+9 /tmp/TMPcoverIN.xpm >> /tmp/TMPcoverOUT.xpm
    convert /tmp/TMPcoverOUT.xpm cover.bmp

Leave a Reply

Your email address will not be published. Required fields are marked *