Hello everybody!

I wanted to change colour images to black and white. (The original images
are 24 bit, after importing in director they are 32 bit)

I tried this with the following steps:

For any pixel in the image, get the color:    color = image.getPixel(x, y)
calculating the average value of the rgb-values:  average = (color.red +
color.green + color.blue) / 3
assigning this average value to the three channels:

      color.blue = average
      color.green = average
      color.blue = average

setting the new color of the pixel:

      image.setPixel(x,y,color)

and this for each pixel.

This method worked on another project. Now it is not working. The resulting
image is not entirely black and white, instead it is green and white.

When I play with the values, I can change the colors, but the main error is,
that it is not monochrome.

What is wrong?

Thanks for any help!

Regards
Michael von Aichberger


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to