# How to easily generate uniform cover images

**URL:** https://community.mp3tag.de/t/how-to-easily-generate-uniform-cover-images/7328
**Category:** General Discussion
**Created:** [October 14, 2008, 2:05am UTC](https://community.mp3tag.de/t/how-to-easily-generate-uniform-cover-images/7328 "2008-10-14T02:05:59Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Moonbase](https://community.mp3tag.de/user_avatar/community.mp3tag.de/moonbase/32/207_2.png) [@Moonbase](https://community.mp3tag.de/u/Moonbase)
#### Post date: [October 14, 2008, 2:05am UTC](https://community.mp3tag.de/t/how-to-easily-generate-uniform-cover-images/7328/1 "2008-10-14T02:05:59Z")

</div>

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](http://www.imagemagick.org/) 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](https://community.mp3tag.de/t/7327/1):

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 😉

---

_[View the full topic](https://community.mp3tag.de/t/how-to-easily-generate-uniform-cover-images/7328)._
