Source Code

Black & White

Converts images to grey scale.

[source code] [compiled]
//-----------------------------------------
// LScript Image Filter - www.StephenCulley.co.uk - Black & White
//

@version 2.5
@warnings
@script image

create
{
    setdesc("www.StephenCulley.co.uk - Black & White");
}

process: ifo
{

    for(i = 1;i <= ifo.height;++i)
    {
        for(j = 1;j <= ifo.width;++j)
        {
            AvgRGB = (ifo.red[j,i] + ifo.green[j,i] + ifo.blue[j,i]) / 3;
            
            ifo.red[j,i] = AvgRGB;
            ifo.green[j,i] = AvgRGB;
            ifo.blue[j,i] = AvgRGB;
         }
    }
}