Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Greyscaling a file?
#1
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
Reply
#2
- 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 ^_^
Reply
#3
Thanks, that was the step I was missing Big Grin
his sig left intentionally blank
Reply
#4
No problem at all ^_^

If there's any more problems just let us know Wink
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)