[sugar] how to make a grayscale image?

Eben Eliason eben.eliason at gmail.com
Thu Nov 1 19:16:29 EDT 2007


Roughly speaking, you can calculate a colored pixel's effective luminance by:

Y = 0.3*R+0.59*G+0.11*B

Just set R, G and B to Y, or use a single channel image with the Y
values.  If python were Matlab  (Which I hate, but it's good at this
kind of thing...) you could do that in "one step." Who knows, maybe
there's a built-in filter you can use to accomplish this anyway, but
that's not my territory.

- Eben

On 11/1/07, Erik Blankinship <erikb at mediamods.com> wrote:
> Anyone know of an easy technique for turning a pixbuf or cairo context into
> grayscale?
>
> (& telling me to put the xo into grayscale mode isn't the right answer :-) )
>
> _______________________________________________
> Sugar mailing list
> Sugar at lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>
>


More information about the Sugar mailing list