Hacker News new | past | comments | ask | show | jobs | submit login
Monochromatic Portraits with GLSL (rosenzweig.io)
56 points by signa11 on July 1, 2021 | hide | past | favorite | 13 comments



Interesting article. I fell in love with the possibilities of GLSL shaders ages ago and tried to incorporate them more into day to day web development.

I wrote a library that enables to "apply" a shader from a GLSL file directly to an <img> tag without any additional bootstrapping needed.

https://github.com/paratron/shaderboy

I havent used it for some time but it sounds like its perfectly suited for projects like these monochromatic portraits :)


GLSL is a fun environment to play around with images. It is a shame that the demo seems to be down at the moment.

A few years ago I did something similar, documented here[0]. It was an enjoyable little project.

[0] https://sheep.horse/2017/9/crossfading_photos_with_webgl_-_b...


GLSL is a fun environment for image analysis. You get a sense of being close to the metal as in the good old days. Horrible code to debug though.

By the way. For me, monochrome == binary.


I've dabbled a tiny bit with shaders, and the only debug method I could figure out was 'paint the area/pixel red if we get to this bit of code'. Not particularly helpful, surely there's a better way!


> For me, monochrome == binary.

As with the Simpsons meme: mono=mono, chrome=colour. So one colour, in two shades or more.


monochrome == binary

Only for the Hue, though.


With binary I meant 1-bit pixels; in mspaint.exe this is called monochrome bitmap. I find the distinction convenient because one dimensional color can be called grayscale or black and white. Maybe 1-bit could be called black or white.


The term doesn't originate with computers, so the mono in monochrome doesn't refer to the 1 bit, but to the one colour. One dimensional colour isn't necessarily grey so monochrome is only greyscale when referring to black and white images.

If you make a cyanotype print of a black and white image the colours are blue, white and all the blue shades in between. One colour, but it's not greyscale.


Fair enough. Anecdotally though I've gone to the printer's and had problems expressing the binary/1-bit color conceptualization.


OT: Why doesn't Chromium have MathML support? It seems like the kind of feature a browser engineer would actually enjoy having in there. Is there a reason to it or did the Chromium team just not get around to implement it yet?


Demo is 404. :(


Yeah, it must be because it's two years old and fell through the cracks. But source is available and it's fairly easy to host the two necessary files:

https://gitlab.freedesktop.org/alyssa/monotone-portraits/-/b...


try using perceptual luminance (L* in L*a*b*) instead of BT.709 relative luminance




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: