Vftdan Channel
25 subscribers
110 photos
2 videos
9 files
178 links
author: @vft_dan
Download Telegram
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
Humans are big neurons. Except they transceive memes instead of simple spikes.
Deterministic subsystem that infers morality and makes decisions based on it should assume it has free will.
Forwarded from ⚠️Invalid Handle (🥴)
🥴 .ass moment
😁2
Do I understand correctly, that the "co-" prefix in #algebra can have two very different meanings:
1. complementary, opposite
2. covariant, preserving, non-inverting
?

#math #maths #language #linguistics
Roman numerals is a (3positive,1negative 5)*2-nary partially positional numeral system

Roman numerals modification that uses IIV instead of III is a (balanced 5)*2-nary partially positional numeral system

#math #maths #original(?)
🤔1
Petition for GitHub to add it as a reaction for issues (specifically, feature requests):
Everybody writes something for the end of the year. I should try too ig.

Globally it was a terrible year. I remember watching two's day Tuesday on yt. It was fun. And soon it began (did Tom mess something up while resetting the Universe?). Zero politics rule in some chats helped to at least keep sanity.

I'm trying to remove negativity and toxicity from my life. It's better to be weird, but nice.

Trying not to loose the most important things from the Internet, we with @kiriharunya organised a chat dedicated to saving and exchanging data. It reached a lot of people from our constellation of telegram communities. There were some people I have never seen before. I now know that if I need flags for ffmpeg, I can ask @DZgas. Thanks @astrra for the services.

I also started posting stuff here and try to not make it a repost dumpster, as I usually do with social media.

This year I read and spoke the most with @hatkidchan. I don't think I made such a big focus on him out of the whole CatSpace community earlier. It's hard to maintain communication with many people. I'm appearing less often in the main CatSpace chat: I cannot keep up with everything that people write there, and also it has a lot of members it didn't have during its creation, and doesn't have some of those it had.

During the summer, I talked to people on hkc's Discord server and played on his Minecraft server with him.

Now we are playing a modpack on a server organised by kiriharu.

A lot of people joined Fediverse this year. That's good. Altho, as most of things in WWW, it has link rot problem.

Thanks everybody, who made this year less bad for me and everybody else! Sorry, if I forgot somebody or something.

I hope, soon everything becomes better than it was ever.
4
Me: *selects several dozens unloaded firefox tabs and drags them to another window*
Firefox: "oh, you also want to load them all!" *proceeds to eat up all available resources*
1
Vftdan Channel
Me: *selects several dozens unloaded firefox tabs and drags them to another window* Firefox: "oh, you also want to load them all!" *proceeds to eat up all available resources*
Manually editing recovery.jsonlz4 in a text editor with the help of mozlz4 and jq to convert it in a human-readable form could very well be a better way to do this task
Forwarded from א. ח.
Moving the tabs to a new window, I am
Load all the content in those tabs, I must
👍1