Skip to content(if available)orjump to list(if available)

How much oranger do red orange bags make oranges look?

Dwedit

Warning, always convert your colors to from sRGB to Linear RGB before doing any math on them, then convert them back to sRGB afterwards for displaying them.

sRGB is the familiar color space you all know and love, it's what your display uses, and it's what has those RGB numbers between 0 and 255. But it's not a linear color space.

First think of values as being between 0 and 1 instead of 0 and 255. To change sRGB to Linear, do X^2.2 (close to squaring the value). To change Linear back to sRGB, do X^(1/2.2) (close to a square root).

In Linear RGB, a value of 0.5 is halfway between black and white. You can put a stripe or checkerboard pattern next to the color value, and it will appear to be the same brightness. But in sRGB, a value of 0.5 is much darker. Linear RGB of 0.5 is roughly equivalent to sRGB of 0.73.

The actual method of conversion involves a complicated curve that isn't continuous, using X^2.2 is still an approximation.

brookst

Even better, convert to HSL or CieLAB. RGB is not at all how our eyes see things.

o11c

For the purpose of blurring, there's nothing wrong with linear RGB.

HSL has the angle discontinuity which is really annoying to deal with and sometimes even impossible to work around.

CIELAB should be fine in theory, but it's not what people actually use on their screens, so I've had some problems with it in practice.

adornKey

CIEXYZ (CIE 1931) had the best brightness axis ever. But the hunt for the best color-axis seems to be ongoing. CIE 1960, CIE 1964, CIELAB/CIELUV 1976...

CIECAM02 CIECAM16 seem to be new iterations. Maybe those are good now?

Dwedit

When I was trying to find how close colors are to each other (such as when mapping an image to an existing palette), comparing color distance in YCbCr worked far better than comparing color distance in RGB.

tobr

For blending, linear RGB is a much better choice than HSL. In HSL, a slightly cool gray (230°, 5%, 50%) mixed with an intense warm yellow (40°, 100%, 50%) might create a hot pink (315°, 52.5%, 50%). Not what your eyes expect.

StableAlkyne

There are also color science packages like this one that let you do conversions to various spaces - https://www.colour-science.org/

throwaway519

Pretty flawed also really.

Basically, anyone that paints knows that the more colours are mixed, the more they tend to brown. Yet because of that misunderstanding in the 1960s in Caltech, in CS more colors = white.

Crazy stuff. A great example of technical debt in systems design where we have all this jazz like sRGB, HSL, HSV, etc, trying to reset that basic mistake in physics from 60 years ago.

AnotherGoodName

When you start from a black screen (eg. a monitor) your primary colors that can form all others are literally red, green and blue. Those are the subpixels that every monitor must have as a minimum. These colors will add to white and mixtures of them can make every color humans can perceive (provided your rgb are at the maximum extremes of each color, otherwise your color triangle is slightly smaller than what rgb can actually do). This is called additive color mixing. Start from black and add color.

When you mix paints your are subtracting from white. The primary colors are 45degrees around the color wheel, namely cyan, magenta, yellow. From those you can make alm other colors by subtracting various amounts of the above three colors from white.

Btw do you know what color model matches your eyes the most? It’s additive color mixing. Your eyes literally start by seeing black and as your eyes let in light the cones and rods that are focused around detecting red, green and blue are triggered in various amounts and you see color that way. You don't see color the same way color is formed from mixing paints. You don’t see cyan, magenta, yellow at all. You see in RGB.

So your painting example is really flawed. Subtractive color models are inly useful for paints.

ajb

Displays are not made of paint, though - they use light.

There are two models of combination:

- subtractive, which applies to paint, since the more you mix in the more frequencies are absorbed

- additive, which applies to light, as mixing an extra light adds the frequencies in it

So additive, where more colour tends to white, is correct.

itishappy

There's been no mistakes here. Additive mixing is the most intuitive way to represent color, just add primaries. Mixing paint is super complicated!

Xmd5a

Additive vs substractive approach to color Displays use the former, so it is natural this is mirrored in software.

trehalose

If you don't believe the people telling you about additive vs subtractive mixing, ask yourself this: How does a prism separate a rainbow of colors out of white sunlight? Shouldn't the sunlight be brown for that to work?

mcherm

> The actual method of conversion involves a complicated curve that isn't continuous

Isn't continuous? Really? That seems surprising to me; tell me more.

froh

it's complicated for appropriate values of complicated.

more specifically it's defined piecewise and the standard then rounds some constants in the definition, which results in a slight discontinuity around the transition from one piece to the other.

https://en.wikipedia.org/wiki/SRGB#Deriving_the_transfer_fun...

angra_mainyu

A piecewise function is definitely not what I'd call "complicated".

itishappy

It's an implementation detail. In theory, it should be continuous.

mrob

>First, the average pixel is not what I would expect it to be at all

It looks like the averaging was done in default sRGB color space, with:

magick "$f" -resize 1x1 txt:-

Downscaling should instead be done in a linear colorspace. Human vision is non-linear, but the filtering required for downscaling is equivalent to blurring, which is linear because it's done optically not within the retina or brain. Using ImageMagick:

magick "$f" -colorspace RGB -resize 1x1 -colorspace sRGB txt:-

Additionally, JPEG supports chroma subsampling, which is usually enabled by default. I don't know what sips does, but with these small files you might as well use PNG and avoid the risk of losing color information this way.

This should produce results closer to human perception.

ipv6ipv4

I'm of the belief that fruit and vegetable packaging is often designed to hide defects, and to make it harder to visually discern how fresh the produce is (on top of not letting you touch it).

Some examples.

Red netting on oranges makes it hard to see imperfections on the skin. Green netting does the same for avocados. Costco sells corn in trays that are cling wrapped with a wrap that is unmistakably designed to hide the ends of the corn (the easiest way to discern if corn has gone bad). Other fruits, and veggies like melons, onions, and potatoes have similar netting with colors that seem to be carefully chosen to maximize visual clutter.

Why aren't all the nets the same color?

Costco sometimes sells pears in plastic trays with multiple creases that cause reflections that make it very difficult to see what the pears inside look like.

adornKey

Supermarkets also sometimes play with the light around the vegetables. Some areas have so much red in the light that you better take the items to a different area to be able to see if they are yellow or orange.

noqc

>The average pixel was not what I expected.

The average pixel doesn't look correct because human vision does not interepret shadowed colors as different colors. We first guess at the shadows, and then do some kind of inverse mapping from the shaded color space to the illuminated one before we "perceive a color". This is why the black,blue/white,gold dress illusion exists.

RataNova

It's kinda wild how much our brain just auto-corrects for lighting without us realizing it

HPsquared

Motion, too.

pixelatedindex

They really don’t look all that different to my untrained eye - in fact I think it looks “better” without the bag. Maybe I’m loco.

horsawlarway

I'm in the same camp. It definitely doesn't look more orange to me. If anything, it looks more brown.

The unbagged oranges are more appealing.

1970-01-01

Brown and orange are not different colors. For some illogical reason we prefer to think that they are: https://youtu.be/wh4aWZRtTwU

dylan604

Please show me in ROYGBIV the location of "brown".

otras

Taking another look, I think you're right! Particularly since the first orange is pretty orange already. I think the first example would have been better served with a yellower, less ripe orange to highlight the difference and the pull in the redder, riper direction from the bag.

happymellon

Could it also be an "anti-marketing" bias?

We know that other people will not be truthful, misleading even.

We subconsciously know that the bag is orange to manipulate us.

Could it look better because you know it's truthful?

bawolff

Colours are often very relative though. We usually don't see a single orange on a white background. I'm not sure that would be representitive of real oranges at the shopping mall.

Also that picture (both versions) are the brownish oranges i have ever seen in my life.

RataNova

The bagged version feels like it's trying a little too hard

alwa

It makes sense that adding red adds red (in addition to the avocado sacks you mention, I think of lemons’ yellow bags, limes’ green bags, and the red packaging/shelf lining and pink-tinged light in the butcher’s case)—but those images really do look strangely exposed to me.

Did you do exercise any specific control over the phone’s camera?

I wonder if the ring light might use the sort of general-market LEDs that underperform specifically at illuminating saturated reds and oranges in this range… see for example

https://www.canada.ca/en/conservation-institute/services/con...

and

https://indiecinemaacademy.com/are-leds-ruining-your-project...

otras

That's a good question, and I could easily see the camera settings (and the light) being a source of error here. Naively, I used the default iPhone camera with the same exposure for each one, then ended up manually removing some of the HDR settings from each one when they were showing up as way overexposed on my computer. Not exactly an advanced, scientific technique, and there was also a bright source of soft white light from the window next to the setup, which could have thrown off the automatic exposure.

Another comment mentioned it, but I wonder if the overall effect would be more visible with yellower baseline oranges (or, as you mention, pale lemons and limes). Really interesting about the LEDs underperforming as well!

nkurz

Along those lines, one big thing I worried about when reading your article was whether the camera's auto-white-balancing might be throwing everything off. I'm not sure how it works on an iPhone, but I'd suspect that presence of the red bag might cause it to reduce the redness of the rest of the image. One easy solution might be to always have two oranges in each photo---one inside the bag, and one sitting on top.

johncalvinyoung

This was my immediate thought when I saw the ring light. Very very likely a CRI of 90 or below, which doesn’t even weight much in red shades. Not uncommon to see 92 CRI with a R9 (red) score below 50% of sunlight or tungsten illumination.

RataNova

This is one of those things I knew on some subconscious level but never really thought about until now. Of course the red mesh makes them look more orange - it's basically grocery store color grading. Honestly kinda love how simple the trick is. No fancy tech, no marketing wizardry - just "put red stuff over orange stuff, profit." Makes me wonder what other dumb little visual hacks are happening around me that I'm not noticing at all.

rightbyte

I need to look at all the nets and see what colors they are I think. Lemons, advocados etc there are probably more in the same class of trickery.

Maybe tomatoes are in boxes that make them look more red? Who knows. I am looking forward to the next super market visit.

dylan604

> Makes me wonder what other dumb little visual hacks are happening around me that I'm not noticing at all.

If it's marketing, all of it. Movies as well.

jaffa2

Am i mossing something or is this really a blog post saying that if you put something red in a picture and compare it to the same thing without red, then the picture with more red, looks, well, more red?

xandrius

If you put an object of color X of intensityn N in a net with color X of intensity N+M, then the object will get some spill over from the net similar to M, which the brain/person doesn't necessarily realise and simply assigns it to the object ad well.

It is also a consumer advice about not comparing an orange inside a bag (of any color) with one outside of one as we have a hard time truly comparing them.

RataNova

It's like science fair energy for adults: "Ok but how much more red, exactly?"

krisoft

I just don’t see the effect. Especialy with the picture on the top, the fruit with or without the net looks the same colour to me.

NicOnHN

Just an FYI, those aren’t oranges.

They are SUMOs which belong to the Dekopon crop type.

rf15

Thanks for clarifying, I was about to ask what kind of oranges those are supposed to be...

jader201

Something is off with those first two pics. The orange already looks red, not orange — with or without the bag.

If you look at the pic below where it shows the oranges in the store, they’re much oranger.

For a post about color accuracy, it seems odd the comparison pics seem to have some color imbalance to them.

dmurray

The best oranges [0] I've had were half green. Fresh from the tree, but still plenty ripe.

It's my understanding that oranges for transport to colder countries are picked unripe and ripened in the holds of cargo ships. This ripening process is great at making the skin more orange, and OK at improving the flavour, but nowhere near as good for that as ripening on the tree.

So if I saw green patches on my supermarket oranges, far from the tropics, I'd be conditioned to expect them to be really good. They wouldn't be, of course.

[0] Satsumas? Clementines? I don't want to get into a debate about what taxonomically is an orange, but these were citrus fruit that turn orange in colour when ripe.

Aloisius

How green an orange is when ripe has to do with the climate they are grown in. In warm climates with little variation in temperature between day or night, oranges will remain green on the tree even when ripe. If nights get cold enough (~55 F), they will turn orange.

That said, in the US, oranges destined for markets de-greened for aesthetic purposes since customers won't generally buy them otherwise.

lightedman

"How green an orange is when ripe has to do with the climate they are grown in."

Not true for all cultivars. For example, the emerald orange rind always looks like a lime.

Aloisius

I'm not familiar with that one and can't seem to find it online. Do you have a link?

Limes will actually turn yellow when ripe. We just pick them early.

Clamchop

Oranges and other citrus are examples of non-climacteric fruits, meaning they do not continue to ripen after being picked. So, they have to be picked at the desired level of ripeness.

RataNova

The best-tasting oranges looked nothing like the perfectly polished, all-orange supermarket ones. Some of them were downright ugly by grocery store standards

ltbarcly3

Some oranges, especially the ones you find in Asia or at Asian fruit stands, can be completely ripe and still completely green. The ones sold in US stores are almost all sour and unripe if they are green (almost always but not always). Different regions in the world 'know about' different citrus fruit (there seem to be a lot of overlap and a lot of non-overlap with fruit), so your mileage may vary. Reddit claims this is because of the temperatures: https://www.reddit.com/r/VietNam/comments/16ca895/why_are_th... It's fun to go to fruit stands when traveling and try the fruits you don't recognize! Lots of fruits are very different if you travel to countries where they can grow them natively, and there are a lot of tropical fruits that aren't exported. Lots of the English words for fruits are re-used so you can be eating something totally unrecognized and it's a "tree cherry" or something.

For example, what they call a lime in a lot of countries (for example Calamansi) would be called a tiny orange in North America (we don't have that fruit here). What we call a lime they wouldn't recognize, but if they saw/tasted it they might think it's a green lemon or something.

Aloisius

> For example, what they call a lime in a lot of countries (for example Calamansi) would be called a tiny orange in North America (we don't have that fruit here).

Calamansi limes are grown in California and usually called Calamondin limes. They're typically anywhere from orange to yellow/green when grown here.

> What we call a lime they wouldn't recognize, but if they saw/tasted it they might think it's a green lemon or something.

What country doesn't have what we call a lime? The Key lime, like the Calamansi is is native to the Philippines and available everywhere the Calamansi is. Persian limes are exported nearly everywhere.

Lots of languages don't differentiate between lemons and limes though.