how to convert a bitmap file to an array ?

stef s.mientki at id.umcn.nl
Tue Jun 5 14:19:03 CEST 2007


Stefan Sonnenberg-Carstens wrote:
> stef schrieb:
>> hello
>>
>> I can find all kind of procedures to convert an array to a bitmap
>> (wxPython, PIL),
>> but I can't find the reverse,
>> either
>>    - convert a bitmap to an array
>> or
>>   - read a bitmap file to an array
>>
>> thanks,
>> Stef Mientki
>>   
> Take a look at the "struct" module.
> There you fill find pack/unpack, which can do what you need.
thanks Stefan,

but using struct, I need to know how a bitmap file is build,
I don't know that (and I rather don't want to know that ;-)

Any better solutions (I'm a spoiled Delphi user ;-)

cheers,
Stef Mientki



More information about the Python-list mailing list