google12 said:
Oh, sorry. I made a mistake...
My question is -- when I run the code described below, the transparence of
the orginal image will be removed. How can I keep the transparence?
im = Image.open(test.png)
fp = open('test.jpg','wb')
im.save(fp,'JPEG')
I believe the thrust of Fredrik's post was: you can't. JPEG does *not*
store alpha channels. It's just not part of the format, so if you need
to store in JPEG format, you will not be storing the alpha channel in
the file.
If what you're asking is whether you can store the alpha data to a
separate file (as is done with programs such as 3DStudio Max), yes, that
can be done too:
HTH,
Mike
_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/