Piotr Legiecki <[EMAIL PROTECTED]> writes:

> Hello
> I wonder how the undo works in gimp?
> I'm currently trying to write a little tool in java which operates on
> big files (70-120MB) and wonder how to make undo memory efficient.
> Lets say I change something in Curves dialog in gimp. It takes effect
> on all pixels. So if I want to undo this operation, I have to have
> *all* the pixels before the operation. Right?

Right, everything that gets dirtied by an operation must be pushed
to the undo stack beforehand.

> So assuming 100MB image,
> the undo operation requires additional 100MB of space for one undo
> step. If I want to undo more such operations I would need image_size *
> undo_steps RAM for undo system?

Exactly, except it's not RAM but tile-cache that gets used for storing
undo operations of pixel data. The maximum in-memory tile-cache size 
can be configured in preferences. Everything that does not fit in
gets swapped out to the disk tile cache.

> I'm affraid this question looks naive, but I can't imagine that the
> algorithm I mentioned above works in gimp. I suspect it is a bit more
> clever.

It works pretty well. I also can't think of something more efficient
since we can hardly save less than the modified amout of pixels on
the undo stack.

You can limit the size of the undo stack or even disable it completely
when working on very large images.

Gimp-developer mailing list

Reply via email to