Author Topic: Translating to black&white  (Read 16245 times)

0 Members and 1 Guest are viewing this topic.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Translating to black&white
« on: February 19, 2005, 05:05:15 pm »
To translate an image from color to black and white, how is that normally done? My guess is that the RGB values of each pixel averaged?

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Translating to black&white
« Reply #1 on: February 19, 2005, 06:02:57 pm »
Judging by my output (which is all plain pixels anyway), averaging the pixels works well.  Gg! :)

Offline Towelie

  • pwnstar
  • Moderator
  • Hero Member
  • *****
  • Posts: 4873
    • View Profile
Re: Translating to black&white
« Reply #2 on: February 19, 2005, 11:40:05 pm »
iago..... Its easy. Instead of RGB mode you use greyscale :-). Then when you switch it back Im pretty sure its still black and white.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Translating to black&white
« Reply #3 on: February 20, 2005, 11:14:34 am »
I'm not talking about photoshop, I'm writing a program.  I have the RGB for each pixel, but I wanted to make them into greyscale.

Offline Towelie

  • pwnstar
  • Moderator
  • Hero Member
  • *****
  • Posts: 4873
    • View Profile
Re: Translating to black&white
« Reply #4 on: February 20, 2005, 08:34:41 pm »
oh well gj.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Translating to black&white
« Reply #5 on: February 20, 2005, 08:52:56 pm »
I found a formula on some website for it:
(0.3*red) + (0.59*green) + (0.11*blue)

Apparently, that's better.