How to easily generate uniform cover images

EDIT: I’m currently testing a new, much improved an less process-intensive version which will easily handle full collections! Stay tuned … I’ll post the new version HERE.

For those of us who need a »near-perfect« collection because they are enthusiasts or use all this for work (i.e., for displaying uniform covers on a radio page), here is a little »How to« to (quite) easily reach the goal of »uniform cover images«.

The Goals:

  • One uniform Cover Image within each audio file, all 160x160 Pixels, 72 dpi, non-square original images filled with white background, all line interlaced JPEG (other source image formats being converted), small memory footprint for use on a web page and in portable devices.
  • One original (big) cover image per album folder.
  • One (auto-generated) (small) cover thumbnail per album folder.
  • Source image must either come from external source or from audio file containing such.
  • Image file names should be "%albumartistsort% - %album%.cover.*" (Original cover image, nearly any format) and "%albumartistsort% - %album%.thumb.jpg" (Good-quality thumbnail, for inclusion in audio file).
  • Procedure should not fail if there is no %albumartistsort% in tag, but use %artist% instead for such cases.
Prerequisites:
  • MP3Tag version new enough to handle the "Tools".
  • Working installation of ImageMagick v6.3.2 or newer. (A great commandline image processing tool set.)
  • At least the tags %album% and either or both %albumartistsort% and %artist% must be filled in before all this works.
  • Existing cover images (Either downloaded and saved as "%albumartistsort% - %album%.cover." within the album folder, or at least one audio file per album that has a usable cover embedded.
Setup:

We will use a setup consisting of three separate parts, since it’s currently not possible to do this all in one action group:

  1. An Action »Export Cover« in case we need to extract the covers from the audio files first. (I recommend running this on the whole collection so all »embedded« covers get extracted. The next step would be to download the missing ones and save them in the respective album folders.) Strictly spoken, it needs only to be run on any one file per album (if it contains a cover image, that is!).
  2. A Tool named »Convert album cover art to 160x160px, 72dpi« that will use some ImageMagick to make nice little thumbnails. You can of course adapt the parameters to whatever you need. This tool will be used to create the small album cover image (one per album folder) from either the extracted or the downloaded »big« album cover. Remember: The original cover image can be almost any format, and it doesn’t have to be square! This tool needs only to be run on one file per album (just to get the name).
  3. An Action »Import Cover« to first delete whatever cover data is embedded in the audio file, then import our new thumbnail into it. This will later be run on all files that should get a cover.
Action »Export Cover«:
$if(%albumartistsort%,%albumartistsort%,%artist%) - %album%.cover

[_] Export duplicate covers

Tool »Convert album cover art to 160x160px, 72dpi«:
Name: Convert album cover art to 160x160px, 72dpi
Path: C:\Programme\ImageMagick\convert.exe
(or whereever you have installed ImageMagick to—important is to select »convert.exe«)
Parameter: "$if(%albumartistsort%,%albumartistsort%,%artist%) - %album%.cover.*" -thumbnail 160x160 -background white -gravity center -extent 160x160 -density 72x72 -quality 90 -interlace line "$if(%albumartistsort%,%albumartistsort%,%artist%) - %album%.thumb.jpg"
[x] for all selected files

This is not very elegant yet—anybody got a better idea? Maybe come up with yet another Export loop creating a batch file instead? Strictly spoken, this should only be executed once per album, so if you mark all audio files, it will do lots of unneeded processing. Since I usually work on one album at a time, I found it convenient enough and just activate it for any one music file per album. Remember: %album% and either %albumartistsort% or %artist% must be already set for this to work! Of course, you should also have a properly named image file in the folder (but it will do nothing if none is found).

Action »Import Cover«:

Import cover from file
Format string for image filename: $if(%albumartistsort%,%albumartistsort%,%artist%) - %album%.thumb.jpg
[x] Delete existing cover art

This will remove all covers already in your selected audio file(s), and then import the cover file we generated using the ImageMagick Tool above.

Done! Enjoy with care. (And let me know about any improvements you make :wink:

Hey Moonbase, I followed your instructions and it works like a charm! Thanks for sharing your solution with us :slight_smile:

I just changed some code to suit my personal cover structure.
Usually I just use google to download my covers (prefer square and big as possible ones!)
and put them directly in my songs folder. Filename and file ending is not important, but it shouldn't be folder.jpg!

In the next step I put this as my tool code

*.* -thumbnail 160x160 -background white -gravity center -extent 160x160 -density 72x72 -quality 90 -interlace line "$if(%albumartistsort%,%albumartistsort%,%artist%) - %album%.thumb.jpg" folder.jpg

Then in Mp3-Tag rightclick --> Tool--> And select the above command
Of course you need to select your songs in Mp3Tag before!

This will convert any picture in the folder to 160x160 and save the result as folder.jpg.

Next I use action "Import cover from file" like Moonbase but with my string just: folder.jpg
Then I select the appropiate song in Mp3Tag and use that new action. Voila - all the folder.jpg will be embedded into the right Mp3 file!

Now we want to create bigger covers that will stay in our songs folder. They can be used for music players like foobar2000! Many great configs will look for a "folder.jpg" inside the songs folder to display it!

First we need to delete all created folder.jpgs!
You can delete them one by one by hand or you can use the windows search to display all of your folder.jpgs, sort by name and select and delete them - really easy this way!

Only the original pics from Google should be left!
Now I created another tool similar to the one before but now I created 350x350 folder.jpg's:

*.* -thumbnail 350x350 -background white -gravity center -extent 350x350 -density 72x72 -quality 90 -interlace line "$if(%albumartistsort%,%albumartistsort%,%artist%) - %album%.thumb.jpg" folder.jpg

The only thing we need to do now is to delete the original pics from Google since we now have our folder.jpgs.
I used windowssearch mode for this again and searched for jpg,jpeg,gif and png and deleted all pics beside folder.jpg!

Done!

Result of our actions:

  • Each song has an embedded 160x160 cover to display in portable audio players or other media players
  • In every songs folder a 350x350 cover was saved under folder.jpg to display them in players like foobar2000, portable audio players...

Hello.

Thank you very, very much for this topic. I tried so many things to get my cover art in batch mode into the files, but nothing really worked. I never got the time and nerves to do it manually. Let the computers work for you, avoid working with them. :slight_smile:

I had done scans from all my vinyls and CDs through the years. Your topic showed me the way to enjoy the covers again. Everything works fine on my computer and my iPod.

Again, thank you very, very much.

One thing solved, another thing unfinished. :slight_smile:

I have quiet a lot of single mp3-songs, all tagged with artist, title, genre etc - but without any album tag. I did not rip them, but got them.

Do you know a time saving way to get cover art without knowing the album name? I do not want to do the search manually.

Best greetings from the

Rabiator

I found this topic while searching for a way to add art to all of my AAC-encoded files for use with portable players.

I was struggling with using the 'if2' function with the "Add Album Art" action, and discovered that it didn't work. 'if', however, does work properly, as in the examples in this thread.

One additional stumbling block:

I have several albums with odd characters in their names. The directory names have those odd characters (primarily colons and question marks, with a few double quotes) changed out for underscore characters (_). The 'create small image' step of this procedure does not seem to work on these directories and filenames.

Any thoughts or help on this matter?
Brad