473,406 Members | 2,867 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,406 software developers and data experts.

write a bitmap using python

Hi,
How can I write a bitmap using python? I have some integer data and
want to generate a bitmap graph for visualization. Any suggestion will
be appreciated.
Sorry if this is an FAQ, BTW, where can I find the FAQ of this list?

thanks
Lihua
Jul 18 '05 #1
5 17283
"lyuan" <ly***@ucdavis.edu> wrote in message
news:c9**********@woodrow.ucdavis.edu...
Hi,
How can I write a bitmap using python? I have some integer data and
want to generate a bitmap graph for visualization. Any suggestion will
be appreciated.
Sorry if this is an FAQ, BTW, where can I find the FAQ of this list?

thanks
Lihua


I chased this down last fall when I needed to visualize some data much as
you describe.

http://www.geocities.com/ptmcg/python/index.html#bmp

Follow the 'module' link to retrieve the bmp.py source.

-- Paul
Jul 18 '05 #2
On Saturday 05 June 2004 12:58 am, lyuan wrote:
Hi,
How can I write a bitmap using python? I have some integer data and
want to generate a bitmap graph for visualization. Any suggestion will
be appreciated.
Sorry if this is an FAQ, BTW, where can I find the FAQ of this list?

thanks
Lihua


The Python Image Library (PIL) is probably what you want:

http://www.pythonware.com/products/pil/

Gary Herron

Jul 18 '05 #3
djw
lyuan wrote:
Hi,
How can I write a bitmap using python? I have some integer data and
want to generate a bitmap graph for visualization. Any suggestion will
be appreciated.
Sorry if this is an FAQ, BTW, where can I find the FAQ of this list?

thanks
Lihua


If you application involves a UI like Qt/PyQt, then there are ample
classes to perform this operation (QPixmap, QImage, etc). Otherwise,
look at PIL.

-D
Jul 18 '05 #4
Hi, Paul,
Thanks for your help. The code is indeed clear and illustrative.

I wonder under what license is your code distributed? Do you mind if I
include part of your code into my code? I'm not writing anything
commercial, but instead a scientific data analysis program.
thanks
Lihua

Paul McGuire wrote:
"lyuan" <ly***@ucdavis.edu> wrote in message
news:c9**********@woodrow.ucdavis.edu...
Hi,
How can I write a bitmap using python? I have some integer data and
want to generate a bitmap graph for visualization. Any suggestion will
be appreciated.
Sorry if this is an FAQ, BTW, where can I find the FAQ of this list?

thanks
Lihua

I chased this down last fall when I needed to visualize some data much as
you describe.

http://www.geocities.com/ptmcg/python/index.html#bmp

Follow the 'module' link to retrieve the bmp.py source.

-- Paul

Jul 18 '05 #5
"lyuan" <ly***@ucdavis.edu> wrote in message
news:c9**********@woodrow.ucdavis.edu...
Hi, Paul,
Thanks for your help. The code is indeed clear and illustrative.

I wonder under what license is your code distributed? Do you mind if I
include part of your code into my code? I'm not writing anything
commercial, but instead a scientific data analysis program.
thanks
Lihua

Lihua -

Re-download the .py file - it now includes an MIT open source license
header.

I'm glad it could help.

-- Paul
Jul 18 '05 #6

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

Similar topics

3
by: kee | last post by:
Hi All, I am trying to write binary data to a file, which is bmp image: Open "d:\temp\test001.bmp" For Binary Access Write As #1 Put #1, 1, strImage Close #1 *** strImage contains binary...
0
by: Gandalf | last post by:
Hi Gurus! Here is a problem with wxPython. I would like to load bitmaps and create a mask for them at once. Here is my idea: the mask colour for the bitmap should be the colour of the pixel in...
5
by: Richie Adler | last post by:
Does anyone know of a bitmap/resource/image collection for a Spanish card deck? I'm planning to create a new cardgame which requires this kind of deck (prototyping in Python and possible final...
2
by: stephen fx | last post by:
Hello all! Using C/C++ I can do this: struct MyStruct { int a; char b; }; MyStruct test;
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
2
by: Cameron Walsh | last post by:
Hi all, I'm trying to extract the data from a bitmap or .pnm file using the following code: import Image img = Image.open("test.bmp","r") data=img.getdata() Unfortunately I get the...
6
by: lanwrangler | last post by:
I know it's a long shot but does anyone have any pointers to generic algorithms - or, even better, Python code - for comparing images and computing a value for the "difference" between them? ...
1
by: Robin Becker | last post by:
I'm having trouble with defining a completely transparent bitmap for use as a stipple in a canvas import Tkinter Tkinter._default_root.tk.call('image','create', 'bitmap', 'gray0',...
16
by: AAaron123 | last post by:
I have a timer. At each tick, say 0.1 second, I write a file. If it takes more than 0.1 second to write the file the app will not work correctly. How can I tell in the tick event if the...
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
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...
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...
0
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...
0
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,...

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.