5 ms·
Latest Kitty terminal release features SRGB correct linear gamma blending
- bitbang 3y agoGetting fonts to render correctly is a difficult task. Compositing in linear color space is the visually correct way to blend colors. But in practice no platform renders and composites fonts in linear color space, and each has opinionated approaches to how fonts should be rendered. Font designers can design a font with a specific platform in mind, that on another platform looks terrible. And people who spend all day working with a terminal can be very picky about how they want text to look. The latest release of Kitty provides tooling to allow tweaking the compositing settings so that any font in any color, can render as desired on any platform.
- foolrush 3y agoThis is not technically correct as best as I can ascertain. When we think about AA, it is a representation of sub pixel occlusion. As such, using uniform tristimulus to sample the “in between” value is incorrect. There is simply no “correct” approach because there are no known models that properly model visual cognition. What we can say though, is that the intermediate subpixel should not sample RGB tristimulus, but a loose nonuniform representation that approximates the lower order visual signal representation. When discarding signal, RGB tristimulus is more “correct”. When interpolating the signal, approximate lightness is more “correct”. Some solid analysis is available here: https://hhoppe.com/filtering.pdf https://hhoppe.com/filtering.pdf
- kevin_thibedeau 3y agoYou don't have to do subpixel AA. It's arguably worse on modern high DPI displays because of the color fringing that wouldn't be present with grayscale AA.
- arghwhat 3y agoSubpixel AA is always bad - it just might be a necessary but disgusting hack on screens with too low resolution to render fonts comfortably... Screenshots and screen recordings of subpixel AA content is foo without magic to get clients to disable such rendition during capture...
- thanatos519 3y agoHow about subpixel hinting? A white 1-pixel vertical line has the same amount of fringing whether it's RGB or GBR or BRG.
- enriquto 3y ago> Getting fonts to render correctly is a difficult task. Only if you insist in blurry fonts. Rendering sharp bitmap fonts is trivial. With the microscopic pixels that we have nowadays, bitmap fonts have more sense than ever. Too bad there is not a lot of variety in bitmap fonts of huge pixel size.
- vladvasiliu 3y agoI actually find that "with the microscopic pixels we have nowadays", all fonts are fine. I'm typing this on a 24" 4K screen, using normal fonts and they are very sharp. I do use sub-pixel rendering and don't have any issue even with light text on dark background (Using Linux X11 with fontconfig 2.14.2). However, the issue is that as soon as you leave high-end laptops, you actually rarely have "microscopic pixels". Most "business" screens are still a blurry mess with 1920x1080 24" panels. 32" 4k panels are serviceable (light text on dark background can get rainbowy), but you better not look at them from too close. 8k panels are still very expensive, at least in Western Europe. For these screens, I've found that bitmap fonts are the best. They're the only way to have really crisp text, and not some rainbowy-mess. And don't get me started on the fashion trend of skinny light fonts on dark backgrounds.
- LoganDark 3y ago> However, the issue is that as soon as you leave high-end laptops, you actually rarely have "microscopic pixels". What? I have had the complete opposite experience. High-end laptops (like, the ones that have multiple GPUs, or portable workstations, or gaming laptops, or etc.) tend to have utterly terrible displays, whereas cheap ultrabooks and chromebooks are the ones that get the 4K treatment. Maybe different allocation of cost?
- vladvasiliu 3y agoIt's indeed probably a question of definitions. I admit I wasn't thinking about "gaming" laptops nor models with dedicated GPUs, since I don't have a use for those and tend to prefer models without. I was thinking about macbooks and the likes of Dell XPS and Lenovo X1. I was referring to them as "high-end" since models with 4k screens tend to cost more than your "regular" enterprise-issue laptops, which usually have atrocious screens. The only laptops with HIDPI screens under 2000 € I can think of are the base Mx macbook airs. Since there are many "workable" (from a performance standpoint) models under 2000 € [0], I consider anything above "high end". I was even eyeing some Dell Latitude and Lenovo P a year or so ago (can't remember the exact model), which I would qualify as "portable workstations", since they had 4 DIMM slots, 3 or 4 NVMe slots and at least one of them actually had some kind of Xeon CPU with ECC RAM. They all had options for a 4K screen. They all cost more than 4000 €. Whereas the laptops we typically get at work (HP Pro and Elite books) top out at FHD, and usually are quite dim and sometimes don't even have 8 bit panels. --- [0] My current laptop is an EliteBook 845 G8. The laptop itself was around 1500 €, and upgraded to 64 GB of RAM and a Samsung 980 Pro, came in around 1800-1900 €. Aside from the absurdly bad screen, it's a laptop that is powerful enough for my needs.
- p-e-w 3y agoWe truly live in a golden age of terminal emulators. I still remember how essentially nothing happened in the terminal world from the late 90s until a few years ago (other than iTerm2 on macOS), and suddenly we have Kitty, Alacritty, Foot, and Wezterm, each developed independently of the others, and each of them better than anything that came before. It's amazing to watch these projects evolve.
- nextos 3y agoAre these better than XTerm wrt latency? I find XTerm (in Linux) and Terminal.app (in macOS) much snappier. These measurements seem to agree with my subjective perception: https://danluu.com/term-latency https://danluu.com/term-latency
- aumerle2 3y agokitty is much better than the rest on latency, see hardware based measurements https://thume.ca/2020/05/20/making-a-latency-tester/ https://thume.ca/2020/05/20/making-a-latency-tester/ showing kitty has the same latency as terminal.app on macos.
- p-e-w 3y agoThose measurements are several years old and thus say essentially nothing about the current generation of these terminals, which are all under very active development. XTerm is X11 only. Considering that Wayland is much more lightweight than X11, it's hard to imagine XTerm beating e.g. Foot, which is purpose-built for modern Wayland desktops, with almost no abstraction in between. Not to mention that these terminals have much better overall engineering than XTerm, whose README famously states "This is undoubtedly the most ugly program in the distribution." That line alone is enough for me to avoid XTerm like the plague.
- AceJohnny2 3y ago> Considering that Wayland is much more lightweight than X11 That's irrelevant. More relevant is that Wayland is adamant about presenting "perfect frames" (ie no frame tearing), which requires a sync/checkpoint for everything that's displaying, which inherently puts a lower bound on latency that non-sync-respecting X11 isn't subject to.
- mtlmtlmtlmtl 3y agoIf tmux control mode was ever implemented for kitty I'd use it, but Goyal hates multiplexers so he refuses to do it. Luckily it looks like wezterm will have support eventually.
- KennyBlanken 3y ago> Goyal hates multiplexers so he refuses to do it. So very on brand for him. Why people keep investing themselves into Goyal's one-man-fiefdom projects is a mystery to me. I haven't used kitty, but I absolutely loathe Calibre more than any other software I use. The man couldn't design a user interface to save his life, common functions nearly everyone wants are time-consuming to set up, and the fact that calibre-web is better in every possible way speaks volumes. It took me years to realize that calibre-web had nothing to do with him, otherwise I would have switched much sooner.
- fileeditview 3y agoI don't get this open reluctance of people that contribute a lot of time and work towards open source. Sounds a lot like entitlement to me. I don't know anything about the drama you mention. I just know kitty is a fine terminal emulator I use all the time (also with tmux/byobu) and I am thankful the author created it. Calibre I also use from time to time and it works for my purpose. I am happy it exists and I can just shovel my ebooks onto my kindle. It sounds like you used Calibre for years but still complain about it even though it's free..
- razemio 3y agoUsually I agree but the maintainer of kitty is bonkers rude. There have been several issues concerning privacy and security regarding kitty. The responses of the maintainer regarding these very valid concerns made me switch to wezterm/sakura/foot in an instant. He also accepts lots of PRs from contributers. Once you do this, it is no longer your project only. An example PR (there are a few others equally concerning): https://github.com/kovidgoyal/kitty/pull/3544 https://github.com/kovidgoyal/kitty/pull/3544
- KennyBlanken 3y agoI've stared at the comparison image between MacOS and Kitty and the only thing I can tell is that Kitty is displaying the colored text in a very different way - frankly, one that is harder to read on account of being lower contrast. In plain English, can someone explain what's going on, and why anyone should care?
- n42 3y agothey've gotten font rendering to be similar to macOS, so the fact that you can't really tell a difference is the point. scroll down for more screen shots that show the improvement
- zokier 3y agoWhich comparison image are you looking at? The images on the linked gh pr show only b&w text?
- Sesse__ 3y agoWhen trying to blend two different colors, for instance when you have antialiased white text on black background (or for that matter, fuchsia text on an image), there's a question on how you do the blending mathematically. The “obvious” way of doing a*alpha + b*(1-alpha) for the pixel values is wrong, since the pixel values don't correspond directly to the number of photons (they are compressed using a non-linear curve, because that allows us to use 8-bit displays instead of, say, 16-bit). In particular, this means that white-on-black and black-on-white don't actually render visually the same. This patch corrects that, and adds some contrast controls since few people would prefer the 100% physically correct blending (I'd assume fonts are not designed for that in the first place, so the alpha value coming out of the subpixel calculation isn't really optimal). This brings it closer to macOS' Terminal.app.