dnkl changed the topic of #foot to: Foot - fast, lightweight and minimalistic Wayland terminal emulator || 1.20.2 || https://codeberg.org/dnkl/foot || channel logs: https://libera.irclog.whitequark.org/foot
boomboxnation has quit [Read error: Connection reset by peer]
ciara has quit [Remote host closed the connection]
boomboxnation has joined #foot
ciara has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
vyryls has quit [Remote host closed the connection]
vyryls has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
Onload has quit [Ping timeout: 252 seconds]
Onload has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
an3223 has quit [Remote host closed the connection]
an3223 has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
tel has quit [Ping timeout: 245 seconds]
dnkl has quit [Remote host closed the connection]
dnkl has joined #foot
dnkl has quit [Remote host closed the connection]
runxiyu has quit [Changing host]
runxiyu has joined #foot
dnkl has joined #foot
tel2 has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
ciara has quit [Remote host closed the connection]
talismanick has quit [Remote host closed the connection]
talismanick has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
ciara has joined #foot
rnd has joined #foot
kode54 has quit [Quit: The Lounge - https://thelounge.chat]
kode54 has joined #foot
<rnd> hey there, i think something's a bit wrong with color blending in foot? if that's possible, i'd like some of you to run a small experiment
<rnd> run this command in your terminal and upload an image of the output, it should be a green text saying "hello world" on a blue background
<rnd> echo -e "\n \e[44m\e[32mhello world\e[0m \n"
<rnd> https://imgur.com/a/AbqzvWs this is what it looks like in foot and kitty (the palette is a clone of the "Campbell" color set from the windows 10 terminal)
<rnd> in foot, there are the edges of the letters seem darker than normal, whereas in kitty, there aren't
<rnd> and if i replicate it in GIMP, the end result also looks like kitty, not foot
boomboxnation has quit [Read error: Connection reset by peer]
<dnkl> rnd: foot currently does not do linear compositing (i.e gamma corrected) of character glyphs. That causes antialiasing to produce the effect you see.
<dnkl> I'd be happy to add an option for this, if we can just figure out a way to implement it
<dnkl> there's as far as I know no support/help for this in pixman, the low level pixel library used by foot
boomboxnation has joined #foot
<dnkl> fwiw, until very recently, very few applications and toolkits have supported this
OtzmaVindicus has quit [Ping timeout: 264 seconds]
<rnd> yeah, gamma correction is surprisingly rare
<rnd> heck, alacritty is also GPU-accelerated, like kitty, and doesn't do gamma correction
<rnd> even ghostty doesn't have gamma correction
<rnd> and windows terminal too, at least judging by the screenshot on microsoft's website
<rnd> oh wait, ghostty has it as an option.
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
<dnkl> hmm, so pixman has sRGB support it seems. We should be able to use that
<rnd> that might work, it would be close enough on most monitors
OtzmaVindicus has joined #foot
<dnkl> rnd: any chance you can checkout the 'srgb' branch (just pushed) and test?
<dnkl> is _looks_ like it's working...
<rnd> let's see
<dnkl> it's a super quick and dirty hack, but wanted to see if I got the approach right
<dnkl> oh, and can I get your color theme? It's easier to see the effect than with my theme
<dnkl> finally, it's slow. Really slow. Not sure how much that can be approved. This is one area where GPU acceleration really helps...
<rnd> it segfaults :-(
OtzmaVindicus has quit [Remote host closed the connection]
<dnkl> try pulling and rebuilding
<dnkl> it probably wont work if you have subpixel antialising enabled. grayscale antialiasing should work
<dnkl> or, it might work, not sure, haven't tested
<dnkl> which font are you using?
<rnd> the font is JetBrains Mono, subpixel antialiasing is off last time i checked (i don't like the way it looks)
<rnd> and yes, it is slow, my cmatrix test shows 60% cpu usage
<rnd> also, doesn't seem to fix the problem :-(
<rnd> the font looks the same as it did before
OtzmaVindicus has joined #foot
<dnkl> alright. I don't have more time right now. It should be possible to get right, I _think_. I just need to better understand how the pixman image surfaces are supposed to be used in this case
<dnkl> fwiw, the pixman changelog specifically mentions gamma aware compositing so I don't think we're completely off
<rnd> i think i just got unlucky with my color scheme choice, when i got to try other terminal emulators, their palettes worked better even if they used the same alpha blending
<rnd> i'm actually kinda surprised microsoft's windows terminal doesn't do gamma-aware compositing, given that their default palette (which is the one i'm using now) makes the artifacts very apparent
<dnkl> this is something I've been wanting to look into for a long time; you just gave me a reason :)
<dnkl> whether or not the end result is usable or not (as in, not dog slow) remains to be seen...
<rnd> so far the only other terminal emulator i've seen that pulls it off right is kitty, and ghostty has it as an option, but the version that added said option is not yet available in my repos
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
<dnkl> rnd: pushed a couple of changes that definitely looks different (and better ihmo). Haven't been able to compare with kitty though
<dnkl> note that emojis aren't rendered correctly (they're too bright), and that no GUI elements do gamma correction (yet)
<dnkl> margins have the wrong color too
OtzmaVindicus has quit [Ping timeout: 264 seconds]
OtzmaVindicus has joined #foot
<rnd> yep, that seems to work, though now the font looks kinda too thick if it's on a transparent background
boomboxnation has quit [Read error: Connection reset by peer]
<rnd> it looks fine if i specifically set a background color tho
<rnd> but otherwise, the new rendering looks indistinguishable from kitty's to me
<dnkl> I'm not sure I follow... it's incorrect with the default background?
<rnd> specifically if the "alpha" option is set in [colors]
<ifreund> I wonder if it could be more performant to render the text on a subsurface and let the compositor handle the (gamma aware) compositing
<dnkl> it's likely an issue with how/when we pre-multily the alpha value into the color channels
boomboxnation has joined #foot
<ifreund> I guess it would require twice as much memory though
<ifreund> probably not a good idea then
<dnkl> ifreund: interresting idea.
<dnkl> I'm not yet sure how to handle the memory in the current implementation either
<dnkl> we need an extra pixman surface. Right now I'm allocing+freeing a small buffer for *each* cell
<dnkl> that's slow, but memory efficient
<ifreund> if the background was always a uniform color it wouldn't require any extra memory (single pixel buffer + viewporter)
<dnkl> unfortunately, that's not the case :)
<ifreund> exactly, though is the case 99% of the time for stuff I do in the terminal
<dnkl> so I might be looking at duplicating at least the current viewport. Or maybe a smallish scratch buffer per rendering thread
<ifreund> why alloc+free for each cell? can the buffers not be reused?
<dnkl> quick and dirty hack :)
<ifreund> I see :)
<dnkl> productified, it'd be the "smallish scratch buffer" mentioned above
<ifreund> Yeah, I follow now
<dnkl> at least now I know how it's done
<rnd> oh, also underlining doesn't work in the rest version
<rnd> *test version
<dnkl> I probably forgot to update the x/y coords there
<ifreund> I wonder if you could use a viewporter single pixel buffer background surface and a mostly transparent subsurface with the text on top, but fill in the cells in the cells in the subsurface that do not match the background color
<dnkl> wouldn't I still have to do gamma correction for those cells?
<dnkl> but yeah, the normal case would be optimized
<ifreund> yes, you'd need to do gamma correction for the filled in cells in the subsurface, this would be an optimization of the current approach for the 99% case
<ifreund> (probably, could use benchmarks to justify)
<ifreund> but I'd assume the compositor doing the work with a gpu would be faster
<dnkl> so, I think that path forward is to "productify" foot's own gamma correction (since we'll need it anyway), and when done, take a look at optimizing it with a transparent subsurface
<dnkl> except.. that approach doesn't support sub-pixel antialiasing...
<dnkl> (need to have the background color when blending)
<rnd> correction, letters also look a bit thicker when not using the [colors].alpha config option
<rnd> just not as noticably
<rnd> (comparing the test version of foot against the regular one in my repos and kitty)
<ifreund> It's very possible I'm missing something major, you know a lot more about rendering text than I do
<dnkl> thicker compared both to kitty and foot regular?
<rnd> yes
<dnkl> hmm, ok, because thicker is expected
<dnkl> but then, if I read kitty's man page correctly, they use a gamma value 0f 1.7 on linux, whereas I use 2.4 (since that's what pixman uses internally when converting between linear and srgb)
<dnkl> nope, read that wrong
<rnd> oh, btw, i use "text_composition_strategy legacy" in kitty because i don't like the default effect
<rnd> if i remove the option, then the test version of foot and kitty look exactly alike
<dnkl> perfect, I think (at least initially) that's a reasonable goal
<rnd> makes sense
<dnkl> if we later want to fine tune the rendering, I think gamma correction is what needs to be tuned.
<dnkl> if I
<dnkl> if I understand things done so far correctly, we're currently doing correct linear blending, but no gamma correction
azerov has quit [Quit: Gateway shutdown]
azerov has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
chilledfrogs has quit [Quit: connection reset by purr]
alexherbo2 has joined #foot
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #foot
MyNetAz has quit [Remote host closed the connection]
MyNetAz has joined #foot
<dnkl> rnd: by the way, you might find this interresting: https://freetype.org/freetype2/docs/hinting/text-rendering-general.html
alexherbo2 has quit [Remote host closed the connection]
<dnkl> TL;DR you might want to enable stem darkening
alexherbo2 has joined #foot
<dnkl> though I'm not sure if .ttf are supported, or only .otf
<dnkl> I do see a difference in foot's srgb branch when I use .otf fonts, and set FREETYPE_PROPERTIES="cff:no-stem-darkening=0"
<dnkl> (for .otf)
chilledfrogs has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #foot
sewn has quit [Ping timeout: 248 seconds]
aktina has quit [Ping timeout: 244 seconds]
sewn has joined #foot
aktina has joined #foot
alexherbo2 has quit [Remote host closed the connection]
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
delthas has quit [Ping timeout: 265 seconds]
delthas has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot