Re: Manipulating large graphics



Scott Gifford <sgifford suspectclass com> writes:
I'm working on an application that deals with extremely large graphics
--- it loads in images of forms and lets you type on them.  Right now
I'm just using a GdkPixbuf, and have run into some of its limitations.
A scanned 300dpi form that's 8.5x11 inches is 8.4 million pixels, and
with 24bit color, over 25MB of memory!  The viewed image is much
larger than the screen, and flickers when it is manipulated.  And I
have to convert PostScript and PDF files into PNGs to edit them.

I'm trying to find a straightforward way to reduce memory usage, to
allow zooming in and out, and to support PostScript and PDF image
formats.

Anybody got any pointers?  

The code and more information about the project is at:

    http://www.suspectclass.com/~sgifford/proforma/


Well, for flicker you can just use a backing pixmap - see the
"scribble" example in the GTK tutorial.

For memory, if you want 8.4 million pixels at 24 bits each, the size
of that is pretty much fixed. Not a lot you can do about it...  there
are elaborate things you can do, like swap portions of the image to
disk; I think the Gimp tries to do some of that, but it's extremely
nontrivial.

PostScript and PDF are even more nontrivial; those aren't really image
formats, they are vector formats. So you need a vector rendering
engine. Again, extremely nontrivial. You could however maybe base your
code on xpdf or ghostscript and get somewhere.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]