Thanks, Ene Uran. This is the closest I've come but there's still an error.
So the program manages to create a "test1.bmp" image but it says "No Preview Available" when I double click on it.
I also get this error message.
Traceback (most recent call last):
File "C:\Python26\January\wxpython.py", line 9, in <module>
File "C:\Python26\lib\site-packages\PIL\Image.py", line 1405, in save
save_handler(self, fp, filename)
File "C:\Python26\lib\site-packages\PIL\BmpImagePlugin.py", line 197, in _save
raise IOError("cannot write mode %s as BMP" % im.mode)
IOError: cannot write mode RGBA as BMP
I figured out what I'm doing wrong and this is actually similar to an error I had before. PIL will not let me convert to bitmap unless the image is black and white first. I'm going to try to convert it to black and white by associating the image with "1".
I did something like that earlier and failed. Attempt #2.
Notice that independently from the pythonic solution above, one can use imagemagick on the command line, it's a specialized tool to convert between image formats. Here is a working command once imagemagick is installed
convert temp.png temp.bmp
This command has many options to manipulate size, color, transparency, etc.
That sounds good but I needed to do everything in Python. Unless this can be run from Python or imported as a module within it?
Actually, it can be used from python. The first way is to use the subprocess module to call imagemagick externally like in subprocess.call("convert temp.png temp.bmp", shell=True), but this is cheating because any program can be called from python this way. Another way is to use one of the imagemagick's python APIs. However, I never tried this myself :)