[cairo] render in grayscale

Bill Spitzak spitzak at gmail.com
Tue Sep 22 10:00:00 PDT 2009

I think the original poster wants to render not the alpha, but something 
like (r+g+b)/3 of the image as grayscale.

This is probably not possible, except by getting the image data and 
applying the math as you copy each pixel to a new image.

If Cairo was to directly support this perhaps it would be an image 
processing operation like blurring and so on, that might be applied to a 
source image as part of some future filtering stack api.

Kalle Vahlman wrote:
> 2009/9/22 Per Hermansson <hermansson.per at bredband.net>:
>> Thanks for the help and quick reply, I only get a black area when I try
>> the code below:

More information about the cairo mailing list