Cover art resizing

One of the more heated debates involving audio tags is: do you organize your files using one directory for every album and put the cover art into a single file into that album (‘folder.jpg’) or do you embed the cover art into the tags of each and every file? Myself, I embed it into all files.

  • the cover art is always with the file, no matter where I copy it to
  • I do not have to put every album into one folder
  • what about single files? You have to embed the art then since creating a folder for one single file seems…strange.

Now, the obvious disadvantage is that the file size will increase. However, take into account that the average digital audio file using lossless compression will be around 4 MB. If you add a few hundred KB’s of album art the file size does not increase that much. So the keyword is: resize that artwork before you embed it. This still poses a problem. JPG compression results are much dependent on the source image. In other words: if you take two images and resize them both down to 800×800 pixels, the chance that they are the same file size is small. So what I do is resize the art to a file which has a certain size. The image’s dimensions will be different for different images but the size will be the same. I used to use 64 KB for my covers which gave me an average resolution of about 450 pixels in both dimensions but recently moved up to 128 KB because there here and there I had images which had to be resized to 300 pixels (which is a bit too small for me).

Anyway, this (obvious to me) operation seems to be something which most image editing programs I’ve found are incapable of doing, so I made a vbscript to do it. It works beautifully: it takes a cover art file and keeps on resizing it until it reaches the desired filesize. (target resolution can be set in the script.) There are some restrictions:

  1. You do need irfanview installed, which is a wonderful free image editor for Windows. But you could use any program you want, provided it can resize images from the command-line. Editing the script is easy enough to accommodate this.
  2. the to-be-resized file has to be on a local drive, not a network drive. It’s easy to script around this limitation but I somehow haven’t bothered yet.

Here is the script: convert.vbs

Usage:

  1. Open a DOS prompt
  2. cd to the directory holding the cover art
  3. execute: cscript convert.vbs <filename of cover art file>

Leave a Reply

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