Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    E

    Eric Brasseur

    4p8.com · Personal blog · on HN since 2008

    Eric Brasseur writes about image processing errors, especially how most software mishandles gamma when scaling and blending images.

    Visit blogHN submissions
    ProgrammingDesign & UXData & Visualization
    What HN says

    HN commenters link his gamma articles as examples of widespread software errors, and use them to argue for correct image downscaling and color spaces.

    Stats for nerds
    30HN people shared it
    7linked in comments
    349story points
    Sep 2016last shared
    2008people per year2016

    Top posts on HN

    1. 1
      All image-editing software gets scaling wrong
      21 people · 346 points · first shared 2008 · 52 comments on HN
    2. 2
      Lew - a graphics programming language along the veins of Processing based on Lua
      1 person · 2 points · first shared 2008 · 1 comments on HN
    3. 3
      Eric Brasseur's Articles
      1 person · 1 points · first shared 2010 · Discussion on HN
    4. 4
      Gamma dalai lama
      3 people · first shared 2010
    5. 5
      Gamma 1.0 or 2.2.png
      2 people · first shared 2015
    6. 6
      Cppcen
      2 people · first shared 2012
    7. 7
      Gamma
      1 person · first shared 2013
    8. 8
      Gamma.html>
      1 person · first shared 2015
    9. 9
      Gallery
      1 person · first shared 2008
    10. 10
      Gamma dalai lama gray.jpg
      1 person · first shared 2009

    What HN people wrote when they linked it

    • jacobolusDec 2015

      A tricky thing w/r/t browsers is that they are often really crappy at figuring out what color space a PNG image is supposed to be in. I think they often intentionally strip out the color space info from PNG images for the sake of helping PNG images blend smoothly into CSS / Flash / etc., for which they also don’t do correct color management. [The CSS spec says that colors should be interpreted as sRGB, but browsers don’t actually follow the spec.]

      As a result of this problem, it’s difficult to judge whether image resizing specifically is being done incorrectly, or whether the image is just being interpreted incorrectly at any size.

      You’ll notice if you open your first test image (http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png) in Apple’s Preview app, you get the correct behavior, but this is different from the behavior in Safari, for example, which shows something incorrect at every size. Stranger still, the behavior in Safari is roughly “correct” while resizing a browser window, but as soon as you let go of the mouse, it reverts to being incorrect.

      There are multiple possible ways to embed color space info into PNG images, and the PNG spec is actually really terrible and confusing on this subject which results in lots of inconsistencies from one implementation to another. If I remember correctly some of them are treated better by browsers than others, but I’m not sure if there’s a way to encode images such that it will be handled properly everywhere (I mean,…

    • corysamaApr 2013

      Hmm... I'm quite familiar with gamma correction. For those who are not, I recently did an "Explain Like I'm Five" http://www.reddit.com/r/explainlikeimfive/comments/1aeuyb/eli5_linear_workflow/c8xlj9i

      But, my understanding is that for an image displayed 1-1 pixel-to-screen there is no intermediate math going on. So, there shouldn't be any opportunity for non-gamma-correct calculations to screw up the output.

      Here's a nice example of non-gamma-correct browsers producing incorrect results after scaling an image: http://filmicgames.com/archives/354 also http://www.4p8.com/eric.brasseur/gamma.html But, in the SO question there is no scaling. So, I'm still confused about the difference in visual results between different applications directly displaying the image...

    • barrkelJul 2010

      127,127,127 feels dark. The explanation is in the article:

      http://www.4p8.com/eric.brasseur/gamma.html#explanation

      Basically, if you have a test image which consists of alternating black and white, it should have the same perceived brightness when you scale it down - but when you scale it down, the software needs to average out the black and white. If it does a simple arithmetic average, it'll probably choose 127,127,127 once it's downscaled enough to become uniform in color. But if you compare that uniform color with the original black and white lines, it looks a different shade - a darker shade. That's because 127,127,127 isn't 50% grey, it's not in the middle between black and white.

      The article has further explanation.

    • ansgriSep 2016

      Enough has been said about incorrect gamma (this and [0]), now I think it's high time to bash the software of the world for incorrect downscaling (e.g. [1]). It has much more visible effects, and has real consequences for computer vision algorithms.

      In the course on computer vision in my university (which I help teaching) we teach this stuff to make students understand physics, but at the end of the lecture I'd always note that for vision it's largely irrelevant and isn't worth the cycles to convert image to the linear scale.

      [0] http://www.4p8.com/eric.brasseur/gamma.html

      [1] http://photo.stackexchange.com/questions/53820/why-do-photos-of-digital-screens-turn-out-the-way-they-do

    • NatsuJan 2011

      I use and love it, but I sincerely wish they'd change the name and the UI. I'm a programmer, but even I didn't realize how much they were hiding in context menus at first until I had to search online to find documentation on how to do the few simple things I can do.

      The multi-window thing I really don't have much of a problem with, though, even if it was hard to get used to at first. I don't have much use for the higher bit depths and such, but I can see his point about quality and why others need it.

      Incidentally, a lot of programs have problems with gamma. I think this link has been on HN a few times: http://www.4p8.com/eric.brasseur/gamma.html

    • leni536Mar 2016

      I know that this is an introduction, but I wish there was a warning about the use of improper color spaces for different tasks (like using sRGB or any nonlinear colorspace for downscaling images, blurring or Phong shading). A warning about the existence of different colorspaces and their different use cases would be enough in an introductionary write up. It's still an issue in most of today's software [1].

      Like open this image in your browser or in your favorite image viewer and scale it down to 50%:
      http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png

      [1] http://www.4p8.com/eric.brasseur/gamma.html

    Related

    Jason Summersentropymine.com22 people

    How web browsers resize images

    Jason Summers
    Personal · last shared 2024
    Bart Wronskibartwronski.com36 people

    Why are video games graphics challenging? Productionizing rendering algorithms

    Bart Wronski
    Personal · last shared 2025
    John Novakblog.johnnovak.net30 people

    What every coder should know about gamma

    John Novak
    Personal · last shared 2026
    Interplay of Lightinterplayoflight.wordpress.com17 people

    How Unreal Renders a Frame

    Interplay of Light
    Personal · last shared 2026
    Herb Suttergotw.ca84 people

    Ritchie, Stroustrup, and Gosling interview

    Herb Sutter
    Personal · last shared 2026
    Eric Lengyelterathon.com38 people

    Poor Foundations in Geometric Algebra

    Eric Lengyel
    Personal · last shared 2026
    Raph Levienraphlinus.github.io128 people

    Thoughts on Rust bloat

    Raph Levien
    Personal · last shared 2026
    Alan Wolfeblog.demofox.org54 people

    Derivatives, Gradients, Jacobians and Hessians

    Alan Wolfe
    Personal · last shared 2026