Better HN
topnewbestaskshowjobs
Log inSign up

raphlinus

14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions

I do research on fundamental UI technology and 2D graphics, with a focus on Rust and fonts. @raph@mastodon.online
Submissions

comment 7y ago · link · parent

One caveat, if viewing this image on a high-dpi display there will be blurring from image upsampling by the browser. My eyes have the same result as yours: the white line appears thicker than the black one.

Here's the interesting thing about your observation: doing alpha compositing of text in a perceptual space (as opposed to a linear space) results in a thickening of black-on-white and a thinning of white-on-black. So doing gamma "wrong" actually results in better perceptual matching.

Do you have evidence that either Apple or Adobe varies the amount of stem darkening based on text luminance? I've tested Apple (macOS 10.12 most carefully) and have not seen this.

comment 7y ago · link · parent

You are correct. Change my third question to, "after applying a correct gamma curve to achieve perceptually uniform line widths in the unipolar case, what is the correspondence of line widths when inverting the polarity to preserve the perception of width matching?" Then you want to break that down into the contribution assuming a perfect display and the effect from lower dpi.

This question is less important than the other two, and plausibly the best place to address the effect is in design, rather than rendering.

comment 7y ago · link · parent

I should have clarified that I meant lines with subpixel phase and possibly widths that are not integral numbers of pixels, ie the antialiased case.

Also I totally agree that we need to take into account the perceptual differences between black-on-white and white-on-black even assuming the display technology is perfect. That's one reason doing these studies is not trivial!

comment 7y ago · link · parent

So obviously text is one of the things I care about a lot. I'm willing to accept your filter as being very good for a lot of stuff other than presenting a GUI.

Does this mean that there is not one true right answer for images, as there is for audio[0]? That you should use different reconstruction filters depending on the application. Is it accurate to say that a pixel is not a little square unless you're rendering text, in which case it is?

[0] I know this is a slight oversimplification, if you care deeply about latency you might choose between linear and minimal phase, etc. But for consumer applications it's true enough.

comment 7y ago · link · parent

Reeeaallly? I haven't made the images, but my intuition is telling me that text will be noticeably blurry compared with a box filter.

I basically agree with your points regarding compositing in a linear space, except that I suspect that thin black-on-white lines will come out looking thin and spindly.

comment 7y ago · link · parent

Be careful generalizing the audio results to pixels. The central lesson of xiph's work is that people simply cannot hear frequencies above, let's say 20kHz. Therefore, as long as your sampling rate is above the Nyquist limit (and under the assumption the signal chain is linear), any reconstruction filter that passes frequencies through 20kHz is effectively "perfect."

There are two ways this is not true for pixels. First, even for "retina" displays the human visual system can make out spatial frequencies beyond the Nyquist limit of the display (this will vary by viewing distance, so is more of an issue for young people who can get close to their displays). Second, even assuming perfect gamma, the display must clip at black and white because of physical device limitations. Thus, especially for text rendering, only a reconstruction filter with nonnegative support is generally useful. Such a reconstruction filter would be an extremely poor choice for audio.

It is true that many of the underlying signal processing principles are the same, and I encourage people to learn and understand those :)

comment 7y ago · link · parent

I imagine this came up partly as a result of the recent alpha compositing discussion.

We desperately need some research, based in user studies and using modern display technology, to settle some basic questions:

* What reconstruction filter gives the best results? Is it the same for vector (text) and natural images? By "best" I do mean contrast (sharpness) and lack of visible artifacts.

* For rendering of very thin lines (relevant to text), what gamma curve gives the perception of equal line thickness across the range of subpixel phase? How does it vary with display dpi? (Hint: it's likely not linear luminance)

* What gamma curve yields the perception of equal width of black-on-white and white-on-black thin lines (also relevant for text)? (Hint: likely not linear luminance)

I've seen a number of discussions where people feel they are able to answer these questions from first principles, and corresponding arguments that doing these in a "correct" way gives results that are less visually appealing than the common assumptions of treating a pixel as a little square (so doing a box filter for reconstruction) and ignoring gamma so effectively using a perceptual color space for the purposes of alpha compositing.

I posit that these questions cannot be solved by argumentation. I think user studies might not be very difficult to do; you could probably get "good enough" results by doing online surveys, though this wouldn't pass standards of academic rigor.

comment 7y ago · link · parent

It definitely depends on druid-shell, but we're also thinking about being a good guest (ie for VST and the like). But honestly our focus is full desktop apps right now.

comment 7y ago · link · parent

The two funded full-timers focused on making a font editor using druid as the GUI toolkit. I personally think this is the best way to grow an ambitious new toolkit from scratch. Also, there's overlap with the xi team, but in Silicon Valley speak you might say we've pivoted.

The GSoC student project is a GPU compute renderer for 2D graphics. Early experiments (piet-metal) show promise that this could advance the state of the art.

comment 7y ago · link · parent

One of those efforts is druid. I'm deliberately choosing not to make a lot of noise on social media yet, but I suggest people actively looking for native GUI in Rust take a closer look. Our team (currently two people funded full time, a GSoC student, plus a growing, dedicated community) is solving the hard problems, and we're on the hook for delivering a basic font editor by the end of the year. The webpage and demos don't look impressive yet, but this is because we're currently focusing on building out the core.

comment 7y ago · link · parent

There is a "color-interpolation: linearRGB" option in SVG, which seems to be implemented by browsers. See http://tavmjong.free.fr/SVG/COLOR_INTERPOLATION/ for a more detailed examination.

comment 7y ago · link · parent

If I were writing it, I might start with a physical interpretation of alpha as a blend of transmission and reflection of light (it basically does this) but emphasizing that has to be actual luminance, which RGB isn't. I'm not even sure I'd add a whole lot of content as rearrange it so the role of linearity in blending was closer to the top.

comment 7y ago · link · parent

Also because it's by far one of the most common things people get wrong, or could do better, when implementing alpha blending.

comment 7y ago · link · parent

It is discussed briefly at the end, but I agree with you that it should have been given more prominence.

comment 7y ago · link · parent

The general concept you're looking for here, I think, is a monoid homomorphism, which also underlies xi-rope. If you can define your own value types, then it seems likely you can do this kind of thing.

comment 7y ago · link · parent

I chuckled, but I have to say that the word "Googley" used to mean something when I was there. It was exemplified by, among others, Claire Stapleton, who would post incredible little stories to go along with TGIF announcements. Retaliating against her for organizing a walkout is one of the most un-Googley things you can imagine. Now that she's left, if someone uses the word "Googley" unironically, you can laugh in their face and tell them I gave you permission.

ETA: I found that Claire has posted a sampling of these on her site: http://cargocollective.com/clairest/Miscellaneous

comment 7y ago · link · parent

I think the original statement is defensible. Many of the original OT papers proposed algorithms that have since been shown not to converge in particular cases (especially the TP2 puzzle). It took a while for the fog to clear, in part because TP2 requires concurrent edits from 3 peers.

I also highly recommend the talk "CRDTs and the Quest for Distributed Consistency"[0] from Martin Kleppmann, which I believe surveys the landscape in as clear and accessible a manner as I've seen; much of the literature is pretty dense.

[0]: https://www.youtube.com/watch?v=B5NULPSiOGw

comment 7y ago · link · parent

I absolutely encourage people to choose the license that works best for them. My motion has been the other way, all my new stuff is permissively licensed. This is basically because I want my work to have broad impact, and have the possibility of collaborating with as many others as possible, including those making proprietary software.

I'm a fan of Drew's work, and also hope to help GPL projects such as Inkscape (I met many such developers at Libre Graphics Meeting). Choose the license that works best for you, and if you can articulate the reasons for your choice, as Drew has done here, even better.

comment 7y ago · link · parent

Interesting. The rules seem to be different on different systems. Deleting two RIS symbols (whether they map to a flag or not) seems right in any case. Some other systems (Android included) will take the accents off separately when they are decomposed (but not for precomposed accented characters). Also note macOS takes just the accent off for Arabic (tested on U+062F U+064D).

comment 7y ago · link · parent

The rules for what you want to do on backspace are complex - you want to delete the grapheme cluster if it's an emoji or ideograph with variation selector, but if it's a combining mark, most of the time you want to just delete that. One place this is written down is [1].

Of course, this might sound like a nitpick but only confirms the actual point you were making, that treating text as a sequence of grapheme clusters is often but not always the right way to view the problem.

If you're talking about cursor motion when hitting an arrow key, then yeah, grapheme cluster.

[1]: https://github.com/xi-editor/xi-editor/blob/master/rust/core...

comment 7y ago · link · parent

This should say 2010. I believe much of it is out of date, as C11 does have a memory model, and does provide both atomics and barriers. Many, if not most, uses of volatile should probably be replaced by atomics.

https://en.cppreference.com/w/c/atomic

comment 7y ago · link · parent

Thanks for providing more detail for my answer to mindgam3's question :)

comment 7y ago · link · parent

Yes, quite seriously - I go to worship most every week, annual session most every year, am on several committees, including the one that does memorial services. There are actually a few computer people at our meeting.

Having a spiritual practice really helps keep me grounded. Keeping it relevant to the article, it's something I would recommend.

comment 7y ago · link · parent

I think you can add stuff like Twine and Inkle's scripting language Ink to that. Their user base is emphatically not programmers, but they are definitely domain specific languages.

comment 7y ago · link · parent

It's not helpful if you're expecting to be handed polished products that do what you want. It is helpful if you want to understand what's going on. I think it would be interesting to get a high quality DVI viewer based on modern graphics tech, but of course such a thing will take time and effort. I plan to meet with Dr. Fuchs in the next few weeks to talk about this and related issues.

comment 7y ago · link · parent

Yes to both. The isolation was pretty bad because I grew up in a rural area and thus there just wasn't a large group of friends to draw on, much less those with similar interests and drive. So I experienced quite a bit of resentment, and strong feelings of social awkwardness.

For me, "resuming normal life" was going into the PhD program at UC Berkeley at 22. I wasn't the only former child prodigy (hi NJ if you're reading!), wasn't the smartest kid in the room. More importantly, I had peers I could bond with. I keep up with a lot of my grad school friends, not so much from the small town where I grew up.

Btw, here's some publicity from the time (there wasn't much, which I think was very wise of my parents): https://archive.org/details/marybaldwin1980mary/page/9

comment 7y ago · link · parent

I'm of the camp who believes it stems from motivation - for whatever reason, I've found computers (and math) fascinating and have found the motivation to spend a lot of time understanding them, without it feeling like effort. I'm not sure I'd say I picked this stuff up quickly, it's been many tens of thousands of hours.

I'm not sure I have any useful advice regarding reading, other than doing quite a bit of it (though these days a lot of it is net stuff, which is varied in quality). Lately I've been reading a whole bunch of papers on GPU, both 2D rendering and how GPU's work (the Citadel stuff is a good read). A couple years ago I read a ton of stuff on CRDT's, and while it obviously grabbed my attention at the time, I look back and kinda regret the effort spent on it.

Hope this is at least interesting, if not helpful.

comment 7y ago · link · parent

I was a child prodigy, now living a life that is a fairly natural extension of that experience. I started programming at 6, took college classes (mostly math and physics) from 9 to 13. I had a semi-successful software business with my dad from 14 to 22, then decided to go to grad school, which was a fantastic decision, as it both helped me sharpen my intellectual skills and develop better social skills.

These days I do independent CS research and open source development, and still enjoy learning. One of my latest projects involves programming GPU compute, and I find it very exciting to grapple with a new computing model.

I don't talk about my early experience that much, but in this thread, feel free to AMA.

comment 7y ago · link · parent

I am cautiously optimistic about this. I recently built a prototype GPU-based 2D renderer which I think has huge potential, but obviously also needs quite a bit of work to become a real product. I've been considering various kinds of hybrid open source business models, where there's a free part but also parts people pay for. I'm pretty sure that can fly, but I'm also hesitating at the idea of spending a huge amount of my time and energy on building a business - I want to concentrate on the tech itself. If I can get close to paying cost of living through sponsorship, that's pretty appealing.

For this to really fly, though, needs to come revenue streams from businesses who depend on open source, rather than other individuals. I'm hopeful this can get there.

comment 7y ago · link · parent

As another datapoint, Knuth-Plass style line breaking is implemented on Android TextView and turned on by default, as of Marshmallow I think. There is a bit of a performance cost, but I personally never came across anybody who turned it off to gain more speed.
1
495051
63