transparent images

M

moishyyehuda

Does any one know how to make a transparent image with specifically
PIL, but any standard python library will do. I need a spacer, and it
has to be transparent.

Thanks
 
B

Brian

Does any one know how to make a transparent image with specifically
PIL, but any standard python library will do. I need a spacer, and it
has to be transparent.

Thanks

Does this have to be done through Python? If not, you might enjoy GIMP
(http://www.gimp.org), which can do this easily. Best of all, you can
customize the size, etc.

Dusty
---
 
H

half.italian

Does any one know how to make a transparent image with specifically
PIL, but any standard python library will do. I need a spacer, and it
has to be transparent.

Thanks

Something like this...not my code...untested...

im = Image.open("image.jpg")
opacity = .5
if im.mode != 'RGBA':
im = im.convert('RGBA')
else:
im = im.copy()

alpha = im.split()[3]
alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
im.putalpha(alpha)

~Sean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top