Re: [Gegl-developer] pre-multiplied alpha and other optimizations

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

 



On Wed, Mar 19, 2003 at 03:49:20PM -0800, Daniel Rogers wrote:
> There seems to be a fairly good agreement that post-multiplied alpha is 
> the way to go.  It is more accurate, and there are currently features of 
> gimp that depend on it.
> 
> I think for those reasons gegl should use post-multiplied alpha (afaik, 
> it currently doesn't).   The loudest dissenters tend to be a little 
> flamey, but I think the most accurate way to go should be where we 
> start, since we want the gimp to look good.  After the gimp looks good, 
> we can optimize without sacrificing image quality.  I suspect there 
> might even be a way to get gegl to decide when pre multipling is a good 
> plan and do it, which would be cool.

It should be able to do both probably. Gimp favors an un-premultiplied
version of composite for painthits on layers. But for Gimp's Layer stack
you could probably get away with a version of a premultiplied
over (You would just premultiply the incoming color from the
layer before using the premultiplied version).

So far I have only coded pre-multiplied versions of the compositing
ops for simplicity.  
 
> In the same vein, I noticed that to multiply two integer samples you use 
> a macro called INT_MULT that does a non-fp division (a bit shift and 
> addition) that approximates the formula:

Alvy Ray Smith talks about this formula some in
"Image Compositing Fundamentals"
as well as un-premultiplied and premultiplied 
versions of composite: 

http://alvyray.com/Memos/default.htm 

While we are here, his "Sprite Theory of Image Computing" is 
interesting too, his description of the compositing system 
he wrote called altimira composer.

Calvin

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

  Powered by Linux