Creating images for HTML emails with GIMP

If you’re designing HTML emails (for instance, newsletters or other mails that are not created with a Mail User Agent), you will know that you have to use HTML 3.2 because of Outlook 2007 and its strange Word 2007 rendering. (By the way, I’d even extend Microsoft’s argument that Word is better for security reasons because it doesn’t understand scripts and suggest using Word 2007 as the default browser for every computer.)

In Word/Outlook 2007 Background images are only accepted in this format:

<body background="URI to image, may be cid: for attached images>

But this is no news. For me, it became really strange when I used GIMP in Linux to create an image that was intended as a background for an HTML email message.

Word is designed for printing. Are emails too?

I created an image with 10.000 px width where the real graphical content was 700 px wide, filled up with white space. Then I wrote:

<body background="cid:img">
<table background="cid:img" cellspacing="0" cellpadding="0">

Sending this to Outlook 2007, it was all OK but the graphical content was much more than 600 px wide.

After playing around, I had the idea that this problem could be related to printing and DPI settings in some way. So I found out that GIMP creates images with 72 dpi per default (you can’t see this except in the images headers because the size in pixels is always the same). For more information about dpi, resolution and when its use makes sense (or not), see this German article: Dpi, Missverständnisse und Erklärung. Then, Outlook tries to render this image on the “printed” screen where the email is displayed (remember, Outlook uses Word and Word is a text processor, not an Internet browser) and so rescales it to get 96 dpi.

The solution: Open GIMP, load the image, set it to 96 dpi and save it again. You won’t note a difference, but Outlook 2007 does — it should work now (as long as users don’t change their default Windows dpi setting, see link above).

Of course, Microsoft, Outlook, Outlook Express, Office, Word, Internet Explorer, and all other trademarks and registered trademarks are properties of their respective owners. GIMP is free software.

Leave a Reply


blog.dev001.net is Digg proof thanks to caching by WP Super Cache