Draw it into a Picture object, and loop over its RGBSurface doing:
      c=rs.Pixel(n,j)
      k=(C.Red * 0.275) + (C.Green * 0.58) + (C.Blue * 0.145)
      rs.Pixel(n,j)=rgb(k,k,k)
you could also just average out the three colours, ie
      k=(c.red+c.green+c.blue)\3
but I found that the one above produced better results. My ImageTools
library [plain RB] does that and much more.

HTH

--
dda
ImageTools, pure RB fast graphics
http://sungnyemun.org/?q=node/3

RBDeveloper Columnist, "Beyond the Limits"
http://rbdeveloper.com

On 3/31/06, Mark O'Neill <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I'm not too hot at graphics, so please
> excuse me if this is a simple question,
> but how would I go about drawing a
> picture (which is a color JPG) as
> greyscale on a canvas?
>
> Thanks for your help.
>
> All the best,
>
> Mark.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to