Posts: 293
Threads: 31
Joined: Nov 2004
I've been working on this problem for a few days now and it still has me stumped. I need to take an image file (.bmp) and convert it to a greyscale image then output it. I've looked at several tutorials on graphics and so far haven't found an answer. :-?
his sig left intentionally blank
Posts: 1,845
Threads: 44
Joined: Aug 2002
- Open the BMP file
- Load all pixels in memory
(^^ tutorials explain a lot about how to do this)
- Convert the colors to greyscale using:
Code:
grey = red * 0.299 + green * 0.587 + blue * 0.114
with red, green, and blue the color components of each pixel, 0-255
Hope this helped a bit ^_^
Posts: 293
Threads: 31
Joined: Nov 2004
Thanks, that was the step I was missing
his sig left intentionally blank
Posts: 1,845
Threads: 44
Joined: Aug 2002
No problem at all ^_^
If there's any more problems just let us know