[wxPython-users] Re: img2py image quality
Robin Dunn
robin at alldunn.com
Thu Nov 8 09:33:25 PST 2007
Steve Senior wrote:
> Hi Robin,
>
> Thanks for the reply.
>
>> Since you are starting out with png's then it wouldn't be too hard to
>> just store them directly in the .py file without going through the load
>> and save.
>
> Would you be able to start me off as to how to achieve this, since I don't have
> the first idea how I would:
>
> (a) get the png's directly into a .py file
> (b) extract them as a bitmap in my application to display them
Everything you need is in wx/tools/img2py.py, and the modules it imports.
>
>
>> Or even a simple tweak to the img2py code could make it work
>> this way by default if it is given a .png. If you want to take that
>> approach with this and send me a patch I'll add it to the distribution.
>
> I'm afraid this a little bit beyond my (wx)python abilities at the moment!
I doubt it. This isn't rocket science. All it should need is to detect
that the input files is already a png and if so bypass the part that
loads and saves it as an image. Instead you can just open the file and
read it as data to get the bytes to be encoded into the Python string.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list