[Image-SIG] Patch for saving .tga files

Alexey Borzenkov snaury at gmail.com
Sat Feb 3 15:20:50 CET 2007

Reposting with plain text:

---------- Forwarded message ----------
From: Alexey Borzenkov <snaury at gmail.com>
Date: Feb 3, 2007 4:55 PM
Subject: Patch for saving .tga files
To: image-sig at python.org

Hi everyone,

Another patch from me, this time to save .tga files. You can grab it here:


However I must note that for saving RGBA images you will need my
another patch I posted earlier today:


The .tga saving I did is the very minimal that *seems* to work for me
(I based it on code that saves .bmp files), however I'm really not
sure about whether I'm saving palette information correctly or not.
The main concern is that I don't know how to determine whether image's
palette is RGB or RGBA, and thus it's possible to lose alpha
information when loading .tga file with BGRA palette and then saving
it back (because palette will be saved as BGR). But I hope it'd help
others nonetheless.

More information about the Image-SIG mailing list