Resize Album Art

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

#!/bin/bash
# aa.sh
# Scale and crop album art for embedding in music tags

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

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.

    #!/bin/bash
    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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>