473,396 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

transparent images

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

May 16 '07 #1
2 1802
mo**********@gmail.com wrote:
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
---
May 16 '07 #2
On May 15, 5:26 pm, moishyyeh...@gmail.com wrote:
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

May 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fearless Freep | last post by:
I know there's a PIL mailing list but I thought I would try the question here as well. I'm using PIL on Python 1.5.2 (stop laughing, it's what the ISP has for CGI and I don't have a choice) ...
5
by: Jim | last post by:
Now this is just weird. And yes, I validated the html and the stylesheet. I created a transparent gif image in Paint Shop Pro 7. I made the mistake of making a transparent png and went along...
8
by: djmanmaster | last post by:
Am I right in thinking that images with transparent areas (GIFs or PNGs) should allow clicks to "pass through" to any underlying elements behind them? I have had no luck getting this to work in...
2
by: Allan | last post by:
I've been trying to get this to work for days. I have a form which needs to be transparent (only the form background). On the form there are two images (32 bit PNGs) with alpha channel...
3
by: Christopher Kurtis Koeber | last post by:
Dear All, I know that I am asking a lot about images lately, but it is just that new issues keep arising. My issue now has to do with transparent images. When I display transparent images,...
0
by: MLH | last post by:
My question is not how to paste images in Access with transparent backgrounds. I've researched 4-6 year old postings adequately describing how to achieve this. Lebans' site does a good job of...
2
by: lord.zoltar | last post by:
I have a couple of images I'm using to try and pretty up some forms. They are PNG images with transparent parts. I have one of them partly overlaying the other, but my problem is with the...
9
by: Chuck Anderson | last post by:
Is it possible to overlay a transparent watermark on an image - dynamically? I'd like the result to look like this example: <http://www.cycletourist.com/temp/photo.php> That is a bit of...
11
by: Marge | last post by:
After importing a VB6 project into Express 2008 I have two gif's with transparency do not display correctly. In VB6 these pictures where used with the image object which had different properties...
2
by: neovantage | last post by:
Hey all, I have created transparent PNG images from text dynamically. But it edges are pixel-ate or we can say edges are distorted. Here is my LINK which shows my generated transparent PNG image....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.