Re: Scanline processing in a GeglOperation

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

 



On Mon, Apr 21, 2008 at 7:41 AM, Hans Petter Jansson <hpj@xxxxxxxxxxx> wrote:
> [Sorry if this gets posted twice; I managed to send the first one with
>  the wrong From: address].
>
>  Hi. I've looked through the docs and (briefly) the list archives, but I
>  can't figure out if it's possible to efficiently process the input to a
>  GeglOperation in a scanline fashion -- i.e. with access to, and
>  outputting, only the pixels of a single, complete row at a time.
>
>  I'm trying to write a Floyd-Steinberg dithering implementation, and the
>  way the algorithm is specified, the order in which pixels are processed
>  is significant. It "pushes" the quantization error ahead of it to the
>  next pixel and to pixels on the next scanline. For more background see
>  [1].
>
>  Is there an efficient way of doing this in a GEGL op?
>
>  [1] http://en.wikipedia.org/wiki/Floyd-Steinberg_dithering

The floyd steinberg type of error diffusion is going a bit contrary to
the way GEGL is designed, since effectivly to bottomright most pixel
depends on the contents of the entire image. Thus if the upper left
pixel in the image changes the entire image needs to change as well.
Thus to correctly implement floyd steinberg you would actually have to
request the processing of the entire image and not piece by piece thus
losing the ability to handle larger than RAM images. The stretch
contrast operation is another operation where single pixels depends on
the entire image.

There are other digital halftoning methods that probably are a much
better match for GEGLs processing design. Where the value for any
given pixel only depends on it's neighbourhood and not the entire
image. (Do also note that GEGL currently does not support <8bit
component, so the memory use if you are going all the way down to
1bit/component is going to be massive as you would have to use
8bit/component to simulate it.)

/Øyvind K.
-- 
«The future is already here. It's just not very evenly distributed»
 -- William Gibson
http://pippin.gimp.org/ http://ffii.org/
_______________________________________________
Gegl-developer mailing list
Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux