7 ms·
I love posts that peel back the abstraction layer of "images." It really highlights that modern photography is just signal processing with better marketing. A
by barishnamazov 10mo ago
I love posts that peel back the abstraction layer of "images." It really highlights that modern photography is just signal processing with better marketing.
A fun tangent on the "green cast" mentioned in the post: the reason the Bayer pattern is RGGB (50% green) isn't just about color balance, but spatial resolution. The human eye is most sensitive to green light, so that channel effectively carries the majority of the luminance (brightness/detail) data.
In many advanced demosaicing algorithms, the pipeline actually reconstructs the green channel first to get a high-resolution luminance map, and then interpolates the red/blue signals—which act more like "color difference" layers—on top of it. We can get away with this because the human visual system is much more forgiving of low-resolution color data than it is of low-resolution brightness data. It’s the same psycho-visual principle that justifies 4:2:0 chroma subsampling in video compression.
Also, for anyone interested in how deep the rabbit hole goes, looking at the source code for dcraw (or libraw) is a rite of passage. It’s impressive how many edge cases exist just to interpret the "raw" voltages from different sensor manufacturers.
- delecti 10mo agoI have a related anecdote. When I worked at Amazon on the Kindle Special Offers team (ads on your eink Kindle while it was sleeping), the first implementation of auto-generated ads was by someone who didn't know that properly converting RGB to grayscale was a smidge more complicated than just averaging the RGB channels. So for ~6 months in 2015ish, you may have seen a bunch of ads that looked pretty rough. I think I just needed to add a flag to the FFmpeg call to get it to convert RGB to luminance before mapping it to the 4-bit grayscale needed.
- barishnamazov 10mo agoI don't think Kindle ads were available in my region in 2015 because I don't remember seeing these back then, but you're a lucky one to fix this classic mistake :-) I remember trying out some of the home-made methods while I was implementing a creative work section for a school assignment. It’s surprising how "flat" the basic average looks until you actually respect the coefficients (usually some flavor of 0.21R + 0.72G + 0.07B). I bet it's even more apparent in a 4-bit display.
- reactordev 10mo agoIf you really want that old school NTSC look: 0.3R + 0.59G + 0.11B This is the coefficients I use regularly.
- ycombiredd 10mo agoInteresting that the "NTSC" look you describe is essentially rounded versions of the coefficients quoted in the comment mentioning ppm2pgm. I don't know the lineage of the values you used of course, but I found it interesting nonetheless. I imagine we'll never know, but it would be cool to be able to trace the path that lead to their formula, as well as the path to you arriving at yours
- reactordev 10mo agoI’m sure it has its roots in amiga or TV broadcasting. ppm2pgm is old school too so we all tended to use the same defaults. Like q3_sqrt
- zinekeller 10mo agoThe NTSC color coefficients are the grandfather of all luminance coefficients. It is necessary that it was precisely defined because of the requirements of backwards-compatible color transmission (YIQ is the common abbreviation for the NTSC color space, I being ~reddish and Q being ~blueish), basically they treated B&W (technically monochrome) pictures like how B&W film and videotubes treated them: great in green, average in red, and poorly in blue. A bit unrelated: pre-color transition, the makeups used are actually slightly greenish too (which appears nicely in monochrome).
- shagie 10mo agoTo the "the grandfather of all luminance coefficients" ... https://www.earlytelevision.org/pdf/ntsc_signal_specifications.pdf https://www.earlytelevision.org/pdf/ntsc_signal_specificatio... from 1953. Page 5 has: Eq' = 0.41 (Eb' - Ey') + 0.48 (Er' - Ey') Ei' = -0.27(Eb' - Ey') + 0.74 (Er' - Ey') Ey' = 0.30Er' + 0.59Eg' + 0.11Eb' The last equation are those coefficients.
- isoprophlex 10mo agoI wouldn't worry about it too much, looking at ads is always a shitty experience. Correctly grayscaled or not.
- wolvoleo 10mo agoTrue, though in the case of the Kindle they're not really intrusive (only appearing when it's off) and the price to remove them is pretty reasonable ($10 to remove them forever IIRC). As far as ads go that's not bad IMO)
- marxisttemp 10mo agoThe price of an ad-free original kindle experience was $409. The $10 is on top of the price the user paid for the device.
- delecti 10mo agoLets not distort the past. The ads were introduced a few years later with the Kindle Keyboard, which launched with an MSRP of $140 for the base model, or $115 with ads. That was a substantial discount on a product which was already cheap when it released. All for ads which are only visible when you aren't using the device anyway. Don't like them? Then buy other devices, pay to have them removed, get a cover to hide them, or just store it with the screen facing down when you aren't using it.
- wolvoleo 10mo agoYes and here in Europe they were introduced even later, with kindle 4 IIRC.
- account42 10mo agoSure, and piss doesn't taste quite as bad as shit yet I still don't want it in my food.
- dheera 10mo agoThis is also why I absolute hate, hate, hate it when people ask me whether I "edited" a photo or whether a photo is "original", as if trying to explain away nice-looking images as if they are fake. The JPEGs cameras produce are heavily processed, and they are emphatically NOT "original". Taking manual control of that process to produce an alternative JPEG with different curves, mappings, calibrations, is not a crime.
- to11mtm 10mo agoJPEG with OOC processing is different from JPEG OOPC (out-of-phone-camera) processing. Thank Samsung for forcing the need to differentiate.
- seba_dos1 10mo agoI wrote the raw Bayer to JPEG pipeline used by the phone I write this comment on. The choices on how to interpret the data are mine. Can I tweak these afterwards? :)
- to11mtm 10mo agoI mean it depends, does your Bayer-to-JPEG pipeline try to detect things like 'this is a zoomed in picture of the moon' and then do auto-fixup to put a perfect moon image there? That's why there's some need to differentiate between SOOC's now, because Samsung did that. I know my Sony gear can't call out to AI because the WIFI sucks like every other Sony product and barely works inside my house, but also I know the first ILC manufacturer that tries to put AI right into RAW files is probably the first to leave part of the photography market. That said I'm a purist to the point where I always offer RAWs for my work [0] and don't do any photoshop/etc. D/A, horizon, bright adjust/crop to taste. Where phones can possibly do better is the smaller size and true MP structure of a cell phone camera sensor, makes it easier to handle things like motion blur. and rolling shutter. But, I have yet to see anything that gets closer to an ILC for true quality than the decade+ old pureview cameras on Nokia cameras, probably partially because they often had sensors large enough. There's only so much computation can do to simulate true physics. [0] - I've found people -like- that. TBH, it helps that I tend to work cheap or for barter type jobs in that scene, however it winds up being something where I've gotten repeat work because they found me and a 'photoshop person' was cheaper than getting an AIO pro.
- bstsb 10mo agohey, not accusing you of anything (bad assumptions don't lead to a conducive conversation) but did you use AI to write or assist with this comment? this is totally out of my own self-interest, no problems with its content
- ajkjk 10mo agofound the guy who didn't know about em dashes before this year also your question implies a bad assumption even if you disclaim it. if you don't want to imply a bad assumption the way to do that is to not say the words, not disclaim them
- reactordev 10mo agoThe hatred mostly comes from TTS models not properly pausing for them. “NO EM DASHES” is common system prompt behavior.
- xp84 10mo agoYou know, I didn’t think about that, but you’re right. I have seen so many AI narrations where it reads the dash exactly like a hyphen, actually maybe slightly reducing the inter-word gap. Odd the kinds of “easy” things such as complicated and advanced system gets wrong.
- bstsb 10mo agodidn't even notice the em dashes to be honest, i noticed the contrast framing in the second paragraph and the "It's impressive how" for its conclusion. as for the "assumption" bit, yeah fair enough. was just curious of AI usage online, this wasn't meant to be a dig at anyone as i know people use it for translations, cleaning up prose etc
- barishnamazov 10mo agoNo offense taken, but realize that good number of us folks who have learned English as a second language have been taught in this way (especially in an academic setting). LLMs' writing are like that of people, not the other way around.
- thousand_nights 10mo agothe bayer pattern is one of those things that makes me irrationally angry, in the true sense, based on my ignorance of the subject what's so special about green? oh so just because our eyes are more sensitive to green we should dedicate double the area to green in camera sensors? i mean, probably yes. but still. (⩺_⩹)
- milleramp 10mo agoSeveral reasons, -Silicon efficiency (QE) peaks in the green -Green spectral response curve is close to the luminance curve humans see, like you said. -Twice the pixels to increase the effective resolution in the green/luminance channel, color channels in YUV contribute almost no details. Why is YUV or other luminance-chrominance color spaces important for a RGB input? Because many processing steps and encoders, work in YUV colorspaces. This wasn't really covered in the article.
- MyOutfitIsVague 10mo agoGreen is in the center of the visible spectrum of light (notice the G in the middle of ROYGBIV), so evolution should theoretically optimize for green light absorption. An interesting article on why plants typically reflect that wavelength and absorb the others: https://en.wikipedia.org/wiki/Purple_Earth_hypothesis https://en.wikipedia.org/wiki/Purple_Earth_hypothesis
- bmitc 10mo agoGreen is the highest energy light emitted by our sun, from any part of the entire light spectrum, which is why green appears in the middle of the visible spectrum. The visible spectrum basically exists because we "grew up" with a sun that blasts that frequency range more than any other part of the light spectrum.
- imoverclocked 10mo agoI have to wonder what our planet would look like if the spectrum shifts over time. Would plants also shift their reflected light? Would eyes subtly change across species? Of course, there would probably be larger issues at play around having a survivable environment … but still, fun to ponder.
- brookst 10mo agoEven old school chemical films were the same thing, just different domain. There is no such thing as “unprocessed” data, at least that we can perceive.
- kdazzle 10mo agoExactly - film photographers heavily process(ed) their images from the film processing through to the print. Ansel Adams wrote a few books on the topic and they’re great reads. And different films and photo papers can have totally different looks, defined by the chemistry of the manufacturer and however _they_ want things to look.
- acomjean 10mo agoExcepting slide photos. No real adjustment once taken (a more difficult medium than negative film which you can adjust a little when printing) You’re right about Ansel Adams. He “dodged and burned” extensively (lightened and darkened areas when printing.) Photoshop kept the dodge and burn names on some tools for a while. https://m.youtube.com/watch?v=IoCtni-WWVs https://m.youtube.com/watch?v=IoCtni-WWVs When we printed for our college paper we had a dial that could adjust the printed contrast a bit of our black and white “multigrade” paper (it added red light). People would mess with the processing to get different results too (cold/ sepia toned). It was hard to get exactly what you wanted and I kind of see why digital took over.
- macintux 10mo agoI found one way to "adjust" slide photos: I accidentally processed a (color) roll of mine using C-41. The result was surprisingly not terrible.
- cge 10mo ago>Excepting slide photos. No real adjustment once taken (a more difficult medium than negative film which you can adjust a little when printing) One might argue that there, many of the processing choices are being made by the film manufacturer, in the sensitizing dyes being used, etc.
- shagie 10mo ago> A fun tangent on the "green cast" mentioned in the post: the reason the Bayer pattern is RGGB (50% green) isn't just about color balance, but spatial resolution. The human eye is most sensitive to green light, so that channel effectively carries the majority of the luminance (brightness/detail) data. From the classic file format "ppm" (portable pixel map) the ppm to pgm (portable grayscale map) man page: https://linux.die.net/man/1/ppmtopgm https://linux.die.net/man/1/ppmtopgm The quantization formula ppmtopgm uses is g = .299 r + .587 g + .114 b. You'll note the relatively high value of green there, making up nearly 60% of the luminosity of the resulting grayscale image. I also love the quote in there... Quote Cold-hearted orb that rules the night Removes the colors from our sight Red is gray, and yellow white But we decide which is right And which is a quantization error. (context for the original - https://www.youtube.com/watch?v=VNC54BKv3mc https://www.youtube.com/watch?v=VNC54BKv3mc )
- boltzmann-brain 10mo agoFunnily enough that's not the only mistake he made in that article. His final image is noticeably different from the camera's output image because he rescaled the values in the first step. That's why the dark areas look so crushed, eg around the firewood carrier on the lower left or around the cat, and similarly with highlights, e.g. the specular highlights on the ornaments. After that, the next most important problem is the fact he operates in the wrong color space, where he's boosting raw RGB channels rather than luminance. That means that some objects appear much too saturated. So his photo isn't "unprocessed", it's just incorrectly processed.
- tpmoney 10mo agoI didn’t read the article as implying that the final image the author arrived at was “unprocessed”. The point seemed to be that the first image was “unprocessed” but that the “unprocessed” image isn’t useful as a “photo”. You only get a proper “picture” Of something after you do quite a bit of processing.
- integralid 10mo ago
- jamilton 10mo agoWhy that ratio in particular? I wonder if there’s a more complex ratio that could be better.
- shiandow 10mo agoThis ratio allows for a relatively simple 2x2 repeating pattern. That makes interpolating the values immensely simpler. Also you don't want the red and blue to be too far apart, reconstructing the colour signal is difficult enough as it is. Moire effects are only going to get worse if you use an even sparser resolution.
- JumpCrisscross 10mo ago> modern photography is just signal processing with better marketing I pass on a gift I learned of from HN: Susan Sunday’s “On Photography”.
- raphman 10mo agoThanks! First hit online: https://www.lab404.com/3741/readings/sontag.pdf https://www.lab404.com/3741/readings/sontag.pdf Out of curiosity: what led you to write "Susan Sunday" instead of "Susan Sontag"? (for other readers: "Sonntag" is German for "Sunday")
- JumpCrisscross 10mo ago> Out of curiosity: what led you to write "Susan Sunday" instead of "Susan Sontag"? Grew up speaking German and Sunday-night brain did a substitution.
- mwambua 10mo ago> The human eye is most sensitive to green light, so that channel effectively carries the majority of the luminance (brightness/detail) data How does this affect luminance perception for deuteranopes? (Since their color blindness is caused by a deficiency of the cones that detect green wavelengths)
- doubletwoyou 10mo agoThe cones are the colour sensitive portion of the retina, but only make up a small percent of all the light detecting cells. The rods (more or less the brightness detecting cells) would still function in a deuteranopic person, so their luminance perception would basically be unaffected. Also there’s something to be said about the fact that the eye is a squishy analog device, and so even if the medium wavelengths cones are deficient, long wavelength cones (red-ish) have overlap in their light sensitivities along with medium cones so…
- fleabitdev 10mo agoThe rods are only active in low-light conditions; they're fully active under the moon and stars, or partially active under a dim street light. Under normal lighting conditions, every rod is fully saturated, so they make no contribution to vision. (Some recent papers have pushed back against this orthodox model of rods and cones, but it's good enough for practical use.) This assumption that rods are "the luminance cells" is an easy mistake to make. It's particularly annoying that the rods have a sensitivity peak between the blue and green cones [1], so it feels like they should contribute to colour perception, but they just don't. [1]: https://en.wikipedia.org/wiki/Rod_cell#/media/File:Cone-absorbance-en.svg https://en.wikipedia.org/wiki/Rod_cell#/media/File:Cone-abso...
- doubletwoyou 10mo agoConsider myself educated, thanks!
- volemo 10mo agoIt’s not that their M-cones (middle, i.e. green) don’t work at all, their M-cones responsivity curve is just shifted to be less distinguishable from their L-cones curve, so they effectively have double (or more) the “red sensors”.
- f1shy 10mo ago> The human eye is most sensitive to green light, This argument is very confusing: if is most sensitive, less intensity/area should be necessary, not more.
- gudzpoz 10mo agoNote that there are two measurement systems involved: first the camera, and then the human eyes. Your reasoning could be correct if there were only one: "the sensor is most sensitive to green light, so less sensor area is needed". But it is not the case, we are first measuring with cameras, and then presenting the image to human eyes. Being more sensitive to a colour means that the same measurement error will lead to more observable artifacts. So to maximize visual authenticity, the best we can do is to make our cameras as sensitive to green light (relatively) as human eyes.
- f1shy 10mo agoOh you are right! I’m so dumb! Of course it is the camera. To have the camera have the same sensitivity, we need more green pixels! I had my neurons off. Thanks.
- Lvl999Noob 10mo agoSince the human eye is most sensitive to green, it will find errors in the green channel much easier than the others. This is why you need _more_ green data.
- matsemann 10mo agoYeah, was thinking the same. If we're more sensitive, why do we need double sensors? Just have 1:1:1, and we would anyways see more of the green? Won't it be too much if we do 1:2:1, when we're already more perceptible to green?
- seba_dos1 10mo agoWith 1:1:1 the matrix isn't square, and if you have to double one of the channels for practical purposes then the green one is the obvious pick as it's the most beneficial in increasing the image quality cause it's increasing the spatial resolution where our eyes can actually notice it. Grab a random photo and blur its blue channel out a bit. You probably won't notice much difference aside of some slight discoloration. Then try the same with the green channel.
- integralid 10mo agoAnd this is just what happens for a single frame. It doesn't even touch computational photography[1]. [1] https://dpreview.com/articles/9828658229/computational-photography-part-i-what-is-computational-photography https://dpreview.com/articles/9828658229/computational-photo...
- cataflam 10mo agoGreat series of articles!
- liampulles 10mo agoThe bit about the green over-representation in camera color filters is partially correct. Human color sensitivity varies a lot from individual to individual (and not just amongst individuals with color blindness), but general statistics indicate we are most sensitive to red light. The main reason is that green does indeed overwhelmingly contribute to perceptual luminance (over 70% in sRGB once gamma corrected: https://www.w3.org/TR/WCAG20/#relativeluminancedef https://www.w3.org/TR/WCAG20/#relativeluminancedef) and modern demosaicking algorithms will rely on both derived luminance and chroma information to get a good result (and increasingly spatial information, e.g. "is this region of the image a vertical edge"). Small neural networks I believe are the current state of the art (e.g. train to reverse a 16x16 color filter pattern for the given camera). What is currently in use by modern digital cameras is all trade secret stuff.
- NooneAtAll3 10mo ago> we are most sensitive to red light > green does indeed overwhelmingly contribute to perceptual luminance so... if luminance contribution is different from "sensitivity" to you - what do you imply by sensitivity?
- liampulles 10mo agoUpon further reading, I think I am wrong here. My confusion was that I read that over 60% of the cones in ones eye are "red" cones (which is a bad generalization), and there is more nuance here. Given equal power red, blue, or green light hitting our eyes, humans tend to rate green "brighter" in pairwise comparative surveys. That is why it is predominant in a perceptual luminance calculation converting from RGB. Though there are much more L-cones (which react most strongly to "yellow" light, not "red", also "much more" varies across individuals) than M-cones (which react most strongly to a "greenish cyan"), the combination of these two cones (which make ~95% of the cones in the eye) mean that we are able to sense green light much more efficiently than other wavelengths. S-cones (which react most strongly to "purple") are very sparse.
- skinwill 10mo ago
- mradalbert 10mo agoAlso worth noting that manufacturers advertise photodiode count as a sensor resolution. So if you have 12 Mp sensor then your green resolution is 6 Mp and blue and red are 3 Mp
- yzydserd 10mo agoAnother tangent. Bryce Bayer is the dad of a HN poster. https://news.ycombinator.com/item?id=12111995 https://news.ycombinator.com/item?id=12111995 https://news.ycombinator.com/item?id=36043826 https://news.ycombinator.com/item?id=36043826
- formerly_proven 10mo ago> It really highlights that modern photography is just signal processing with better marketing. Showing linear sensor data on a logarithmic output device to show how hard images are processed is an (often featured) sleight of hand, however.
- fsckboy 10mo ago>It really highlights that modern photography is just signal processing with better marketing your perception of the world is just signal processing that's susceptible to marketing