Hacker News new | ask | show | jobs
by whym 941 days ago
It looks like this is what it does essentially:

                let luminance = (0.2126 * avg_r as f32 + 0.7152 * avg_g as f32 + 0.0722 * avg_b as f32) as u8;
                let character = match luminance {
                    0..=31 => '#',
                    32..=63 => '@',
                    64..=95 => '8',
                    96..=127 => '&',
                    128..=159 => 'o',
                    160..=191 => ':',
                    192..=223 => '*',
                    224..=255 => '.',
                };
https://github.com/thed24/ascii-gen/blob/main/src/converter....
1 comments

What does 'luminance' mean in this context?
It's scaling the colors differently to account for perceived brightness differences instead of just averaging RGB values.
Ah, thank you!