473,624 Members | 2,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image creation

I need to generate wx.Bitmap with a hole in them, i.e. the whole bitmap
is one colour, greyish with alpha = 255*.6, except for one rectangle
that has alpha = 0 .

Currently I'm doing this with PIL, thus:

def _init_mask( self ):
mask = Image.new( 'RGBA', self.size, color=options['mask_colour'] )
draw = ImageDraw.Draw( mask )
draw.rectangle( self.clip_area. box, fill=( 255, 255, 255, 0) )
self._mask = pilToBitmap( mask, alpha=True )

Obviously this is inefficient, but I couldn't find any way to give
alpha values with wxPython's image objects and premature optimization
etcetera... Well, now the program works, but is a bit sluggish so I'm
asking if anyone can give me some pointers to speeding this up.

/Odalrick

Nov 2 '06 #1
0 833

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

Similar topics

1
1772
by: Eric | last post by:
I've got a fairly simple php script which creates a simple gif image. Now, if I use this script on my primary webhost, everything works correctly and the image is created. However, I would also like to see it working on my local machine and in this case, I just get back the standard broken image icon. I am guessing something is not configured properly, but I am uncertain as to what that might be.
5
1786
by: Jim Buzbee | last post by:
I have a subroutine that inserts image objects into a page for me. It works fine except for one thing. My mouseover settings don't appear to take. i.e. I see nothing at all when I move the mouse cursor over the image. If I replace the object creation code with a plain document.write, it works. : // this works as expected document.write("<img src='marker12.gif' \ id='1' \
7
1963
by: Nathan Sokalski | last post by:
I have been trying to find a way to prevent the images on my site from being cached on the user's machine. I want to avoid this because the images used in an Image control often change, yet have the same name. When they are cached, the cached image is displayed which is not what I want. I thought that using Response.Cache.SetCacheability(HttpCacheability.NoCache) would have achieved this, but it seems to only prevent the .aspx file from...
5
4387
by: Tompa | last post by:
Hi, I would like to create images on the fly as a response to an http request. I can do this with PIL like this (file create_gif.py): from PIL import Image, ImageDraw print 'Status: 200 OK' print 'Content-type: text/html' print print '<HTML><HEAD><TITLE>Python Dynamic Image Creation Test</TITLE></HEAD>'
7
4722
by: MVM | last post by:
I am using SQL server and ASP to create a webpage and display images directly from the database. My code is working fine, the issue I am having is when a photo is not in the database. For example, we have a table of homes and a table of photos. Not every home has a photo. So when I search the photo table for a photo that does not exist I want to display a "No Image Found" gif. Below is my code. homedetail.asp: <img...
4
8521
by: Dean Card | last post by:
Okay, so here is the situation. I have need to do some on-the-fly image creation. I have everything working great except for the last part of it, applying a perspective type transform to the image. The transform will take a rectangular 2D image and transform it to a 3D representation in 2D. Please see the link to see what I am trying to do: http://seanberry.com/transform.png I have PIL v1.15 installed which has a PERSPECTIVE...
8
3029
by: Alexander Fischer | last post by:
Hello, I am writing a gallery script and use imagecreatefromjpeg and fpassthru to output images without any change to them (i.e., no thumbnail creation etc. - just deliver the image via the php script). However I note that the image creation is quite slow - the user can see that the image is created line-by-line, from top to bottom. Most likely this speed issue comes from PHP, since PHP is simply slower than C etc.
7
3780
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g. time / date Nice to have:
3
2884
by: RK | last post by:
Is there an image handling guru out there than can help a newbie with understanding dynamic image creation? The question: I can create an image from within Javascript with MyPic = new Image() ....and then assign a source with MyPic.src = "./picture.gif";
1
3387
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. The problem is when it creates transparent PNG format image then and it pixel ate the image. e.g. If i am using a gradient in background then it vary in color range. Now when i used that php script it generates image successfully but it pixel ate...
0
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.