Feedback

Please leave feedback and comments. I am always interested to hear how people get on using these LScripts!

Friday 10 June 2011

LScript - Image_Black&White


LScript (Layout) black & white image filter.

Compatible with Newtek LightWave 9.6 and above.

// LScript Image Filter - www.StephenCulley.co.uk
//
// web   address: http://www.stephenculley.co.uk
// email address: email@stephenculley.co.uk

/* 
    LScript Image Filter - Black & White

    Image_Black&White.ls

*/

@version 2.5
@warnings
@script image
@name *Black & White

    // Title
    sTitle = "*Black & White";

    // Version
    sVersion = "v1.0";

create
{
    setdesc(sTitle);
}

process: ifo
{
    iProgress = ifo.height;
    if(runningUnder() != SCREAMERNET) moninit(iProgress);
    for(i = 1;i <= ifo.height;++i)
      {
      for(j = 1;j <= ifo.width;++j)
        {
        nAverage = (ifo.red[j,i] + ifo.green[j,i] + ifo.blue[j,i]) * (1 / 3);
         
        ifo.red[j,i] = nAverage;
        ifo.green[j,i] = nAverage;
        ifo.blue[j,i] = nAverage;
        }
      if(runningUnder() != SCREAMERNET) if(monstep()) return;
      }
}

options
{
    reqbegin(sTitle + " " + sVersion);

    // Developer
    ctrl_dev0 = ctltext("","developer: Stephen Culley","http://www.stephenculley.co.uk");

    return if !reqpost();

    reqend();
}


All scripts available at my Google Drive at
https://drive.google.com/open?id=1cR_q2GVUAJHumic1-A3eXV16acQnVTWs

No comments:

Post a Comment