Some personal notes  relating to iTunes, primarily from a programming point of view and not in any particular logical order. Please note that this is primarily for my own reference and is a work in progress.
iTunes Version: 184.108.40.206.
The first image, i.e. the one on display in Cover Flow, is stored on disk (but also retained in the tags) when Cover Flow is turn on (for performance reasons) in ITC format and in the tags when not.
Artwork that accompanies purchased tracks is in PNG format and, at the time of writing (June 5, 2008, U.K.), is around 400px by 400px (in the ITC files). Artwork for non-purchased tracks obtain via iTunes is in JPG format and is around 600px by 600px . Although larger images are provided in JPG format they are of lower quality. It is not unreasonable to deduce that all files are derived from one image (see Artwork Export below).
iTunes has no support for artwork type, e.g. cover, media label, etc.
iTunes should be able to handle images in any format that is supported by QuickTime.
Adding artwork to media items can be achieved in a number of ways ;
Exporting artwork as separate files is achieved via scripting and should return either a PNG or JPG file . Unless the artwork is for a purchased media item, the input format is the decider on the output format. Basically, any non-lossy input format should result in a non-lossy output file (PNG). Purchased tracks would seem to be the exception as a resized JPG image is returned.
If you wish to retain the highest quality for the purchased media items then the iTunes provided image needs to be the first one. As you cannot? determine the iTunes provided items then an (extreme) method would be to back up your entire library and files then convert the ITC files before iterating through the artwork items and deleting the first image until there is only one left. Restoring the backed up files would then return the state of things.
There are a number of articles available regarding the ITC format, some of which run to a detailed examination, but for my own use a simple means to convert them to a standard format is enough.
The files are stored in an unusual directory structure based upon the Persistent ID of the media item(s) they relate to. If the media item is a purchased one then the location is easy to calculate, but if not the identifier would seem to be related to an existing Persistent ID of a file that isn’t necessarily in the local library.
If you are not concerned about absolute quality then it isn’t an issue as the files can be obtained via scripting. It must be noted that you may need to consider the deletion of any files you manually add — at some point you may want higher quality ones than can be obtained from your iTunes library.
Is either a PNG or JPG file with an additional header ;
Update: iTunes 8 changed the format of the ITC files to store multiple PNG/JPG files, presumably for the view by album feature.
Are stored in the tags of the media files and so access to the database is not required.
The library consists of a proprietary database (iTunes Library.itl). Also created and, continually updated as iTunes is running, is a separate XML file (iTunes Music Library.xml). The XML file is in reality and an Apple Property List (similar to Windows INI files) and is more formulated for readability than parsability. It is therefore not easily processed via the usual means and so, due to the size of some of the files, some manipulation may be preferable before treating it as an XML file. More…
Exported playlists share the same format.
 All notes are based upon the Microsoft Windows version of iTunes.
 There may be regional variations in the files provided. I have seen varying reports of the image sizes and whilst I have no reason to suspect they aren’t true, copyright concerns over providing printable artwork and, more especially, the abuse of the iTunes services by non-customers would seem to be a good reason for the limited sizes provided at present.
 Tested with PSD, PNG, BMP and JPG, but only by exporting the images using iTunes and not extracting the images from the media files.