[Project_owners] Display images in greyscale?

Jed jedbro at gmail.com
Mon Jan 22 20:20:20 PST 2007


Another option would be to look at the Ghostzilla project. They did
this on the old 1.0.1 codebase.
See: http://www.ghostzilla.com/ and check out the source.



On 1/22/07, Aron Rubin <aronrubin at gmail.com> wrote:
> On 1/21/07, Balaganesh Damodaran <bg.play at gmail.com> wrote:
> > Er... I'm a total dunce when it somes to javascript so i'd appreciate a
> > bit more detailed explanation of what exactly im supposed to do with the
> > function...
> > regards,
> > bg
> > Aron Rubin wrote:
> >
> > >// luminosity value from color components
> > >function rgb2lum( r, g, b ) {
> > >  return( (0.299/255.0)*r + (0.587/255.0)*g + (0.114/255.0)*b );
> > >}
> > >
> > >On 1/19/07, Balaganesh Damodaran <bg.play at gmail.com> wrote:
> > >
> > >
> > >>Hi guys,
> > >>    I need to force firefox into displaying any image on any page in
> > >>greyscale. Is there any way to do this???
> > >>Regards,
> > >>bg
> > >>
>
> The only way I know to do this would be to use the canvas image
> element. I don't think you can access the pixel data from the w3c DOM.
> You would use getImageData() to get the pixels (image data). For each
> pixel get the luminance (with the supplied function and then set each
> color channel to the luminance. Then you would use setImageData() to
> write the pixels back out.
>
> http://www.whatwg.org/specs/web-apps/current-work/#getimagedata
>
> Aron
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>


More information about the Project_owners mailing list