Fast 2D Raster Rendering with GUI

Ivan Illarionov ivan.illarionov at gmail.com
Mon Mar 17 21:53:11 EDT 2008


On Mar 18, 4:36 am, dave <man... at gmail.com> wrote:
> Hi All. I've been formulating in my head a simple image editor. I
> actually started prototyping is some time ago in Java, but am liking
> Python more and more. My editor will be nowhere near the level of Gimp/
> Photoshop, but I do need fast pixel level control and display. For
> instance, that means no automatic anti-aliasing and that I will be
> implementing my own line drawing algorithms.
>
> I've got the high level architectual aspects of my program down, but
> am stuck on what graphics API to use. I want a canvas area of
> adjustable size which users can draw on with as little lag as
> possible. The canvas area will be composed of layers (i.e. I require
> an alpha channel) and I need to be able to zoom in and out of it (zoom
> levels will be at fixed intervals, so this can be simulated if need
> be.)
>
> I started looking at PyGame but realize that I need to integrate a GUI
> into the whole thing (or integrate the image  into the GUI rather) and
> I didn't see a straightforward way to do that. Of course, I don't even
> know if PyGame is the right API for the job anyways :P
>
> Any thoughts or ideas that could help me get started? Thanks!

Look at the PIL source code for reference and implement your own C
extensions for drawing and image manipulation. Or write your app on
top of PIL. Any GUI toolkit will work if you find the low-level access
to their image memory buffers. PyGame is for multimedia applications,
you probably need Tkinter, Qt, wx or GTK.

And as long as you need such low-level things as custom drawing and
anti-aliasing your API is plain old C malloc's, free's and raw memory
addresses.

--
Ivan



More information about the Python-list mailing list