Stephan Assmus | 14 Sep 11:16 2006

Re: agg::renderer_base_pre VS agg::renderer_base

Hi Dave,

dave <at> wrote:
> There are three ways of blending pixels:
> - plain pixels to pre-multiplied pixels
> - pre-multiplied pixels to pre-multiplied pixels
> - plain pixels to plain pixels.

you gave a very nice explaination. I'd like to add that whenever bitmap 
data is processed which contains transparent pixels, you absolutely _need_ 
to have this bitmap converted to premultiplied format to be able to filter 
it in any way. Otherwise the semi transparent pixels will have wrong 
weighting (too much influence), or you need to compensate this in your 
filters (much more processing!). All the filters in AGG are written in a 
way that they only work correctly with pre-multiplied image data. When you 
retrieve your bitmap data from a file, you need to know wether the image 
data is already pre-multiplied or not. For example, PNGs should not be 
pre-multiplied while in TIFFs, it can be either way.
In AGG 2.4, most pixel_format classes have a function to pre-mutliply the 
whole rendering buffer.

Best regards,

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo