Vftdan Channel
25 subscribers
110 photos
2 videos
9 files
178 links
author: @vft_dan
Download Telegram
Channel photo updated
Files for the channel & chat photos
Would prefer to remove text anti-aliasing (or make the alpha channel single bit), but haven't found such option
1992: split a file into a multivolume archive to fit into floppy disks
2022: split a file into a multivolume archive to fit into discord upload filesize limit
πŸ‘1
I'm a calendar
πŸ‘1🀯1
Unfortunately, my Firefox isn't undefined or higher
😁2
⑨
πŸ‘2πŸ‘Ž1
Forwarded from βš οΈInvalid Handle (owo)
βš™οΈ πŸ” Vftdan
There are 2 ways to treat your Thinkpad:

cc
@hatkidchan @dettlaff
πŸ‘2
πŸ₯°1🀯1πŸ₯΄1
1. Google for an InterTurkic conlang
2. Follow the link to http://ib.frath.net/w/InterTurkic
3. From it, follow the link to Turkestan
4. ???
5. Start loosing your mind
Vftdan Channel
Apparently, images can store their pixels' rgb values premultiplied by their alpha value, so drawing them over backgrounds takes 1 less operation https://www.youtube.com/watch?v=XobSAXZaKJ8 #links #video #youtube
Actually, I think I have never read about the proper way of overlaying several colors.

But when I was in the middle school and was writing JavaScript on an iPhone, I think I read about getImageData and setImageData on habr.com and so tried working with it myself. I either invented or read somewhere (possibly in that article) about lerp function and somehow invented myself a way of overlaying 2 rgba colors. The formula for the resulting alpha was a monstrosity of a redundant number of lerps.

Later, in the high school, I found that code, simplified the formula and used it again for working with ImageData.

So, I'm interested how correct my formula is. I'll translate (hopefully, correctly) it to GLSL, so it's (probably) easier to read, apparently lerp is named mix there:

float aa = (1.0 - fg.a) * bg.a;
gl_Color.rgb = mix(fg.rgb, bg.rgb, aa);
gl_Color.a = aa + fg.a;


I. e. resulting alpha = lerp(bg.alpha, 1, fg.alpha). It makes sense indeed: if fg.alpha = 0, then the background color doesn't change, so alpha is bg.alpha; if fg.alpha = 100%, then the foreground color is the result, so alpha is 100%.

So according to this code, you actually need (1 - bg.a * (1 - fg.a)) instead of fg.a to be multiplied by fg.rgb, so premultiplication is only useful for fully opaque backgrounds.

#original
πŸ₯΄2
Cascading jaywalking consensus protocol
πŸ‘1