Computer Color is Broken

Поділитися
Вставка
  • Опубліковано 19 бер 2015
  • Thanks to www.audible.com/minutephysics for supporting this video!
    MinutePhysics is on Google+ - bit.ly/qzEwc6
    And facebook - / minutephysics
    And twitter - @minutephysics
    Minute Physics provides an energetic and entertaining view of old and new problems in physics -- all in a minute!
    Music by Nathaniel Schroeder / drschroeder
    This video made possible by the following Patreon Supporters:
    Mark
    Wes Brown
    John Green
    Florian Philipp
    Rens van der Heijden
    Bob Bolch
    Daniel Ametsreiter
    Joël Quenneville
    Richard Pearson
    David Dailey
    Steven Mulder
    Karim
    Ethi Raj
    Ryan Kyle
    William Ricketts
    Collin Mandris
    Matt
    Jonathan Foster
    Siddharth Sadanand
    Maarten Daalder
    Robby Olivam
    Alan Browning
    Jonathan Piersa
    Julia Person
    James Craver
    Sarah Chavis
    Yonatan Bisk
    Richard Campbell
    Chris Barrett
    Jan A
    Christopher Coleman
    Daniel “YoureDown” Breger
    Hendrik Payer
    Daniel Yip
    Matt K
    William Pearson
    Kevin Lynch
    Nick Ward
    Kevin
    john eriksson
    Allan Farrell
    Tobias Olesen
    Chris Chapin
    Michael Keefe
    Jon Mann
    Bert Goethals
    Joji Wata
    Adam Naber
    Rob Ibsen
    Jacob Gumpert
    Peter Collier
    Andi Davis
    Aarthy
    Raymond Cason
    Evan Gale
    Paul
    Tori McClanahan
    Andrew Stobie
    Dominik Steenken
    Danilo Metzger
    Christian Altenhofen
    Ezra Lee
    Roy Morgan
    Olivia Darroch
    Amber Ciarvella
    ryan horlacher
    Keith Chang
    Milokot
    Janel Christensen
    Will Scherer
    Mike Fulcher
    Larom Lancaster
    Liam Callaway
    John Harman
    Christos Papandreou
    Fernando Pazin
    Johnathon Kinville
    Jason Medrano
    Andrew Barnett
    Katharina Schuchmann
    John Gietzen
    Michael Tardibuono
    Matthew Hebert
    Christy Filipich
    Pierre-Louis Bourgeois
    Genevieve Lawrence
    Brian D'Agostini
    Chris
    Dominik Menzi
    Ryan A. Schauer
    Daniel Johnson
    Nico Houbraken
    Michael Carr
    Ragnhild
    Elizabeth Meisterling
    Lysann Schlegel
    Magnus Krokstad
    Chase Turner
    Owain Blackwood
    Russ Arrell
    Brenden Bullock
    Asaf Gartner
    Mark Samberg
    Tina Johnston
    Mike Cochrane
    Tom Murphy
    Peter L
    Jeff
    Erica Pratt
    David
    Artur Szczypta
    David Drueding
    Nicklas Ulvnäs
    Nigel W
    James Nelson
    Mary Foster-Smith
    Clayton Neff
    Michael Merino
    Jason and Gayle Corfman
    Mihaly Barasz
    Steven Klurfeld
    Richard Bairwell
    Tamas Bartal
    Erven
    Justin Prahl
    Michael Maitlen
    John Harman
    Hans van Staveren
    Kasey
    Karlin Nazario
    M K
    Jacques LABBÉ
    Geralyn Byers
    jason black
    Candice Blodgett
    Daniel Gibbs
    Henry Berthelsen
    Andy Kittner
    Steve Hall
    Erdumas
    Rob Snyder
    John Kelly
    Jessica Rosenstein
    Bill Tomiyasu
    Vasco Simões
    Eoin
    Simon Hammersley
    iain
    Holger
    Alexis Carpenter
    Jay Goodman
    Joseph Perry
    Mark Govea
    Eduardo Rampelotto Gatto Created by Henry Reich
  • Наука та технологія

КОМЕНТАРІ • 3 тис.

  • @katiefrances531
    @katiefrances531 7 років тому +4143

    ahh!!! this means a lot to me as a digital artist!! thank you for explaining why my drawings turn out like garbage when i try to blur them

    • @fart2
      @fart2 7 років тому +79

      Me too, it really help me as a digital artist :D

    • @futurestoryteller
      @futurestoryteller 7 років тому +21

      I don't understand how it helps. What do you do to fix the problem?

    • @Phenrex
      @Phenrex 7 років тому +130

      futurestoryteller They could find an application that properly blends colors, such as the aforementioned settings with photoshop :p

    • @elbryan9
      @elbryan9 7 років тому +80

      In Photoshop, you create a custom RGB setting with a gamma of 1.0. Edit>Convert to Profile. Click on the Profile drop down menu and select Custom RGB. Then type in a gamma of 1.0. You may also want to change the Primaries to Adobe RGB 1998 (mine defaults to HDTV for some reason).
      As for any other programs, couldn't tell ya.

    • @samalass466
      @samalass466 6 років тому +7

      If youre trying to blurr little dots or something like that, lower the opacity and lower the size of your smudge tool.

  • @chase_like_the_bank
    @chase_like_the_bank 8 років тому +1721

    This actually helped me so much with the raytracer I was writing

    • @rich1051414
      @rich1051414 8 років тому +225

      +chasenallimcam I am a programmer who did not know this, but experienced this before. Now I know why, and will surely forget before i need it again.

    • @hardwirecars
      @hardwirecars 8 років тому +125

      +Richard Smith give me your email ill set up a spam program to remind you every 3 hours or so. anything so i dont have to fix your mess later.

    • @rich1051414
      @rich1051414 7 років тому +9

      My reasons are different, generating color gradients mathematically for display in RGB, the color space of the frame buffer.

    • @ranger.1
      @ranger.1 6 років тому

      hal hahah ok!

    • @internetdoggo4839
      @internetdoggo4839 4 роки тому +1

      Wow, that's dope

  • @victoriam586
    @victoriam586 6 років тому +183

    I'm a professional illustrator, and you just taught me something. I'd always assumed it was because image editors were intentionally treating colours like pigments and mixing them subtractively instead of additively, since the result generally fits.

  • @Juniorfunny24
    @Juniorfunny24 5 років тому +656

    >An Adobe product not having the default option be the best choice.
    As typical as the sun rising in the morning.

    • @ForfunckleStudios
      @ForfunckleStudios 4 роки тому +4

      haha hating on adobe cause everyone does it how funny and original

    • @TheDeathKnight
      @TheDeathKnight 4 роки тому +85

      @@ForfunckleStudios Hating a company due to their bad consumer practice is clearly wrong

    • @Narauto_
      @Narauto_ 4 роки тому +2

      same por Apple

    • @jaekoff5050
      @jaekoff5050 4 роки тому

      Nice greentext.

    • @KilianMuster
      @KilianMuster 3 роки тому +6

      @@ForfunckleStudios Hey I've been hating on Adobe ever since Photoshop 2.5 you whippersnapper!

  • @CLipka2373
    @CLipka2373 7 років тому +767

    Interestingly, the non-linear storage of brightness in computer graphics did not evolve as a clever deliberate choice; instead, it was merely a legacy from the display systems used back then: Cathode ray tubes. Their brightness happens to be roughly proportional to the square of the control voltage. Designers of TV broadcasting norms were aware of this, and decided to compensate for this effect in the broadcasting side of the system, to keep the receivers as simple as possible. When those same receivers were later adapted as computer displays, the computer engineers never seemed to have paid any attention to this detail. It was only when computers started to be used in the printing industry that this quirk started to get any attention in computer technology.

    • @ranger.1
      @ranger.1 6 років тому +5

      CLipka2373 Very good

    • @TuckerDowns
      @TuckerDowns 4 роки тому +16

      It turns out that while it was a by product of the physics back in the day, It has stuck around because it is actually useful for data compression.

    • @brod515
      @brod515 4 роки тому +3

      @@TuckerDowns how is it useful for data compression; I've never fully understood that point.

    • @Ruhrpottpatriot
      @Ruhrpottpatriot 4 роки тому +15

      ​@@brod515 Roughly speaking, taking a square-root means keeping the first half of a numbers most significant bits and dropping the other half, essentially cutting the size in half. This is more complicated in practics, but I how you get the idea.

    • @brod515
      @brod515 4 роки тому +3

      @@Ruhrpottpatriot This still doesn't quite make sense. information like that would be stored in 4 byte floating point numbers which will still use all the bits to represent a number. I don't think that's what he was referring to as compression... there is a common idea that storing the values non-linearly stores only the useful information for the human eye and I don't quite understand it.

  • @xINVISIGOTHx
    @xINVISIGOTHx 9 років тому +402

    the bass in this video is shaking my house

    • @cyclone8200
      @cyclone8200 9 років тому +31

      it ruined my sub

    • @arooobine
      @arooobine 9 років тому +2

      cyclone8200 I see what you did there.

    • @florisr9
      @florisr9 9 років тому +10

      You should check your sub's volume...

    • @Xenro66
      @Xenro66 9 років тому

      INVISIGOTH Bangin' tunes mate. Amirite?

    • @EirikXL
      @EirikXL 9 років тому +7

      This comment was so random I had to lol.

  • @angelorf
    @angelorf 5 років тому +142

    Gamma correction is like daylight savings time. The actual mathematical operation is super easy, but I can't for the life of me figure out whether to do the one step or its inverse. I keep rewatching this video time and again.

  • @ThePizza28
    @ThePizza28 3 роки тому +44

    I noticed how as an artist I never use even a tenth of all the very bright white values available to me, and it irritates me a lot when my dark grey gets 1 unit closer to black but it looks much darker...

  • @urinstein1864
    @urinstein1864 9 років тому +274

    Minute Physics
    Minute Maths
    Minute Biology
    Minute Technology
    4 Minutes of Awesome

    • @casaverdero
      @casaverdero 9 років тому +9

      Where is minute chemistry?I am a chemist

    • @Nvortex15
      @Nvortex15 9 років тому +1

      casaverdero there isnt

    • @rubenlucescu5651
      @rubenlucescu5651 9 років тому +34

      casaverdero "In science, there is only physics, all the rest is stamp collecting" -Ernest Rutherford

    • @Regnorash
      @Regnorash 9 років тому +4

      Ruben Lucescu But we need math for physics....

    • @foobargorch
      @foobargorch 9 років тому +2

      Regnor Math isn't a science (there's nothing empirical about it)
      What is meant by that quote is that at the time physics was a reductionist use of math make testable predictions, most other sciences were still concerned with just phenomenology.

  • @deusexaethera
    @deusexaethera 6 років тому +17

    As a computer programmer, I think this is less an issue of laziness and more an issue of not realizing the color values were square-rooted in the first place. Thanks for sharing this information.

  • @Ayverie4
    @Ayverie4 8 років тому +415

    My mind is blown once again. Thank you, MinutePhysics.

  • @descent8275
    @descent8275 7 років тому +69

    thank you. Now all I see is incorrect bluring.
    :P

  • @caramida9
    @caramida9 9 років тому +540

    Nope... beauty isn't the default... laziness is... ask any engineer...

    • @Sebastian-hg3xc
      @Sebastian-hg3xc 9 років тому +46

      performance. computers haven't always been this fast. the image formats come from a time where desktop computers were slower than your average smart phone. he was even making this point in the video.

    • @caramida9
      @caramida9 9 років тому +13

      ***** That was in the past... however in software in the present still use the same technique... answer... laziness... trust me I'm first year in IT engineering...

    • @DoctorPaco
      @DoctorPaco 9 років тому +67

      Are you kidding? You think that you can speak for all engineers because you are a first year IT engineering student? Don't make me laugh.

    • @Zer0Mem0ry
      @Zer0Mem0ry 9 років тому +3

      caramida9 Engineers should develop better alternatives for jpeg, png and bmp since they're way outdated.

    • @Pocket-Calculator
      @Pocket-Calculator 9 років тому +20

      VirtualCoder Except they already exist and nobody uses them.The same way there has been an alternative to .docx that's one trillion times better and nobody uses it.And the same way averyone should be using .webm instead of .gif but then again nobodo does.

  • @AbrahamAnimations
    @AbrahamAnimations 8 років тому +128

    Wow! Just checked and Photoshop does mess it up :( But! Blender's node editor, free 3d software, makes it yellow how its supposed it be! :D

    • @AbrahamAnimations
      @AbrahamAnimations 8 років тому +31

      *****
      Thats ok :)

    • @jaredcfw
      @jaredcfw 8 років тому +23

      +Abraham Animations Yup Blender is awesome like that. XD

    • @EliteRocketBear
      @EliteRocketBear 8 років тому +3

      +Abraham Animations Comparing Blender and Photoshop doesn't make sense tho. They're both made for vastly different reasons.

    • @AbrahamAnimations
      @AbrahamAnimations 8 років тому +7

      *****
      True, but in the sense of blurring, photoshop doesn't do it quite right :)

    • @EliteRocketBear
      @EliteRocketBear 8 років тому +7

      Abraham Animations Does it just fine, if you toggle the right mode. The fact that barely anyone noticed this thing prior to this video just speaks volumes how little it matters. And for those whom it does matter (See graphic designers, Texture artists, etc) Photoshop has the option right there for them already, even back in the earlier incarnations of the software, because they know who uses it.

  • @vizzysfizzys
    @vizzysfizzys 3 роки тому +22

    that moment when your drawing program has blurring on an image but it knows what it’s doing and doesn’t make it ugly

  • @lucasok1185
    @lucasok1185 11 місяців тому +2

    Damb I remember when this video was new, one of the first videos I saw on the channel. I am really enjoying UA-cam recommending me old minute physics videos all of a sudden

  • @saquist
    @saquist 9 років тому +18

    WOW, that was WAY more relevant to me as a photographer than I thought it would be when I clicked on the video

  • @AngelAlvarado57
    @AngelAlvarado57 8 років тому +324

    As a student of computer science I can say this is accurate. We learn to blur images with the wrong approach and then with the good approach. It's about understanding how computer graphics work, the same for bubble sort, we learn the easiest method first. What is wrong is have the wrong method in professional tool as the video says.

    • @Sebb747
      @Sebb747 8 років тому

      So, can you tell me whether the default RGB-values using approach is wrong? Or is this about actual formats?

    • @AngelAlvarado57
      @AngelAlvarado57 8 років тому +2

      +Sebb747 like the video says our human vision can't tell the difference between bright colors but dark colors. So, instead of wasting data storing bright colors we can have a better image by storing the root of the original bright value. It's like the mp3 format, instead of saving inaudible sounds we delete those frequencies.

    • @Sebb747
      @Sebb747 8 років тому +1

      Angel Alvarado Yes, I'm well aware of this. I'm in CS myself.
      But if you do image processing, you usually convert your image into an RGB(A) array which you then work with instead of working with the raw data of whatever image the user chose to supply to you.
      My Question was whether those RGB values are representing square roots and are being multiplied down the graphics pipeline or whether this is just a problem for people who choose to - for whatever reason - work with the raw image data.

    • @AngelAlvarado57
      @AngelAlvarado57 8 років тому

      +Sebb747 You can't know unless you have the data from the original source, take for instance a camera, you can set the gamma values on it but once the photo/video is taken all is stored in the basic RGB(A) values. The same when displaying the image, you can change the gamma values in your TV or screen. The thing for us as developers is how to treat those pixels, you can choose the lazy path and use the mean to "blur" the image or be aware that it's not that simple and you need to consider all cases. Color math is an interesting topic as well.
      I stopped learning about IP but there are a lot of resources out there.

    • @Sebb747
      @Sebb747 8 років тому +1

      Angel Alvarado Guess I'll have to write a test case for my image generation stack. Thanks anyway :)

  • @rerere284
    @rerere284 4 роки тому +4

    As a (hobby) programmer, I come back to this video occasionally to remind myself about this. Thank you. On this watch I realized I've programmed contrast wrong in a few programs.

  • @TigerDan04
    @TigerDan04 4 роки тому +1

    Thank you! That was an awesome video to go with my coffee. I learned something and now I want to figure out which editing programs will give me those gorgeous RGB blends!

  • @highdough2712
    @highdough2712 8 років тому +610

    More than one million views and no comments??
    As a person who does does a lot of graphic art on the computer, I'm amazed I didn't know this before. And why this has not been fixed.

    • @highdough2712
      @highdough2712 8 років тому +22

      ***** Yes. I see them now. I did find it very strange.

    • @highdough2712
      @highdough2712 8 років тому

      ***** Thanks for the tip. I will try that.

    • @Gnomefro
      @Gnomefro 8 років тому +8

      +Mason Bially In general, the downsides of open software with regards to bugginess, lack of support, and most importantly, lack of economic incentive to fix problems, far outweigh any theoretical advantages.
      _"Also, you as the user can always fix the problems with open software."_
      Absolutely not. Almost no users are competent to fix problems with any large software package - even if they happen to be professional programmers - that stuff is just a pipe dream in 99% of cases, possibly slightly better if the problem can be fixed by writing a plugin.
      The most laughable part of it though, is that if I, as a programmer, ran into a problem with an open source image processing package and knew what the problem was, it would almost certainly be 100 times quicker for me to write my own special purpose program to just do that particular job instead of spending days or weeks attempting to understand the original program to the point where I could modify it safely without breaking other things.
      The typical case is that open source software is written by a handful of dedicated enthusiasts, with minimal programming input from users. Blender is a prime example of this, as large critical portions of the program is developed by one guy.(I know this because the lack of development effort prevented me from using the software at one point and it was decidedly not worth my time to write the software myself when I could just buy it from an actual business)

    • @spectrium-gamingandanimati2185
      @spectrium-gamingandanimati2185 8 років тому

      +Julien12150 that happens to me all the time on my phone

    • @Nicse4s
      @Nicse4s 7 років тому +27

      The reason it hasn't been fixed is for larger images, the ammount of time a proper blur takes is far more meaningful then smaller images. a 1024x1024 image has just over 1 million pixels.
      The first method uses an addition and division operation per pixel (The colors are already square rooted), So for the picture using the first method, just over 1 million additions and divisions
      The second method uses 1 addition, 1 division, 2 multiplications (squares), and 1 square root (The most expensive basic math function a computer can do(Not counting trig functions)). So this multiplied by 1 million, and it would take 1 million additions, divisions, and square roots, and 2 million multiplications.
      If you are going for a faster program with less wait time between blurring operations (paint, photoshop) or less intense software on older hardware in general, you go with the 2 million operations rather then the 5 million operations

  • @minecraftace123
    @minecraftace123 8 років тому +2693

    He just basically called Apple lazy :D

    • @ethanchou4906
      @ethanchou4906 8 років тому +336

      +minecraftace123 Ya apples are lazy they just hang on trees

    • @minecraftace123
      @minecraftace123 8 років тому +41

      +Ethan Chou How very true. . .

    • @dz4k.com.
      @dz4k.com. 8 років тому +77

      The level of polish we've come to expect from Apple products

    • @shrekdreck2429
      @shrekdreck2429 8 років тому +137

      You're right, like i'm totaly sure the apple engineers just accidently put 2gb or DDR2 RAM in a computer that has 2 4GHz quad core processors. It totaly wasn't just to scam idiots out of their money or anything.

    • @minecraftace123
      @minecraftace123 8 років тому +6

      LE/A Tyrone Indeed, indeed!

  • @DrgnAnim
    @DrgnAnim 4 роки тому +12

    this explains alot
    i thank you for letting us know this

  • @tibschris
    @tibschris 8 років тому +8

    Beauty is the default! Look how elegantly an entire image was stored using as few bright gradations as the human eye can even notice!

  • @ImmaterialDigression
    @ImmaterialDigression 9 років тому +251

    Is there a setting for this in GIMP?

    • @samramdebest
      @samramdebest 9 років тому +21

      I want to know the same thing, I think GIMP does this because i found the settings, cubic and linear. (with standard cubic)

    • @builderecks
      @builderecks 9 років тому +52

      On my copy of gimp it did it right by default.

    • @unvergebeneid
      @unvergebeneid 9 років тому +6

      builderecks Using which filter? I tried Blur, Gaussian Blur, Motion Blur ... none of which did the right thing. I also tried cubic and sinc interpolation when upscaling and even that didn't do the right thing. That's pretty shocking I have to say. This was all done using Gimp 2.8.10.

    • @unvergebeneid
      @unvergebeneid 9 років тому +3

      samramdebest That's only the interpolation between pixels when scaling the picture. So all but nearest neighbor go through the same colors; just the shape this gradient takes is different. It's got nothing to do with gamma correction. The images in this article explain it much better than my words did: en.wikipedia.org/wiki/Bicubic_interpolation

    • @builderecks
      @builderecks 9 років тому +6

      Penny Lane Don't know if maybe the default settings are different on linux (which is what I use) blur, Gaussian and motion all smoothly blended with no darkness issues in the color test I did.

  • @LectionARICCLARK
    @LectionARICCLARK 9 років тому +47

    Beauty should be the default. That's true in many circumstances.

    • @General12th
      @General12th 7 років тому +1

      Too bad most things and most people aren't beautiful.

  • @Nothing-cx4jt
    @Nothing-cx4jt 2 роки тому

    Simply amazing. Thank you so much for this marvelous work.

  • @maddimoulds4328
    @maddimoulds4328 6 років тому +2

    I know this is a old video but can I just say it's AMAZING how easy this is to understand. I have a very shitty range of skills in maths. I do not understand what square roots,timestables are like rocker science to me,ect ect yet despite this I can still understand what your saying. Good job on the way this was worded!

  • @BoogsterSU2
    @BoogsterSU2 9 років тому +172

    I'm gonna blatantly send this video to all iOS and software developers.

    • @Huntracony
      @Huntracony 9 років тому +116

      Boogster Su I like that that implies that IOS developers aren't software developers.

    • @whiteautumn2075
      @whiteautumn2075 9 років тому +7

      lol like they're gonna listen to what people actually want

    • @jumpstart8159
      @jumpstart8159 9 років тому +7

      Just because he mention iOS doesn't mean windows android works different. As you can see he only mention Instagram even those every website works the same way.
      Morons. He just used something he know people are familiar with

    • @GoldenKingStudio
      @GoldenKingStudio 9 років тому +12

      Yes, because they are all incompetent people who know nothing about this problem...

    • @insect212
      @insect212 9 років тому +32

      Apple isn't stupid, they picked the inaccurate method for a reason, it's fast. Squaring and then square rooting takes up a lot more processing power, if they would have went with that it would have been laggy. I did some tests and the square root method of finding averages was 30x faster.
      Edit: someone pointed out to me that using lookup tables (essentially a long list of per-caclulated values) can speed up the squaring method. I tried that and it really speed it up. Using lookup tables the squaring method is now only 2.6x slow, which is a performance hit IOS developers could handle, so yes they are lazy.

  • @DanErwin
    @DanErwin 9 років тому +12

    Can I vote to see a sequel to this video explaining "color space"??
    Relating to monitors, tvs, and any digital (or non-digital) final presentations. It would shed more light on the subject... "Color space" can be hard to get your head wrapped around: What are you working/editing in? vs. what is the final output in? and how to compensate appropriately.. The sheer amount of different "color spaces" reminds me of the frustration in the amount of different video codecs there are... which could be another interesting topic/video to explore..??
    #danerwinfb

  • @bmayden
    @bmayden 8 років тому

    This is an interesting problem I had noticed, yet not really pondered much about. Thanks for explaining the reasons for it. Square roots matter more to me now.

  • @ilyboc
    @ilyboc 4 роки тому

    Great I am sure I watched this video at a certain point in time but now that I am learning game dev and wanting to understand gamma correction for textures I watched it again and it makes more sense now.

  • @UnPuntoCircular
    @UnPuntoCircular 9 років тому +14

    I can't believe you made a video for this.... hahahahahah AWESOME!

  • @1ucasvb
    @1ucasvb 9 років тому +38

    In Photoshop, when creating a new image, set "Color mode" to "Lab color". That'll set it as the default for new files.
    When saving to PNG or JPEG, you'll need to go to Image > Mode and set it to RGB.

    • @akinoreh
      @akinoreh 6 років тому +4

      Checking "Blend RGB Colors Using Gamma" seems to only work for painting (on RGB Color Mode). When I blur the image, I still get the black edges.
      Switching to Lab Color produces correct results both with painting and blurring whether "Blend RGB Colors Using Gamma" is checked or not.
      Using Adobe Photoshop CC 2017.

    • @Fynmorphover
      @Fynmorphover Рік тому +2

      What the heck is Lab Mode, why does everything look better lol (now when you desaturate, the black and white values picture look actually correct). Why do we even use RGB mode?

    • @official-obama
      @official-obama 9 місяців тому

      @@Fynmorphover cielab?

  • @MatteoCavasin
    @MatteoCavasin 5 років тому

    brilliant video! understandable and yet in-depth. Finally, I know what the gamma in colour setting is!

  • @joshl6462
    @joshl6462 4 роки тому

    Thanks for explaining gamma in a way that doesn't make my brain crust over. I enjoy graphics algorithms and the Gaussian blur issue here is very useful to know!

  • @DeadUnicornClub
    @DeadUnicornClub 9 років тому +2174

    Americans blend away the u in color.

    • @Mega3rn3st
      @Mega3rn3st 9 років тому +223

      *colour

    • @chaquator
      @chaquator 9 років тому +148

      lol
      i bet brit bongs say "loul" instead, too

    • @Irixion
      @Irixion 9 років тому +16

      chaquator
      Colour rhymes with 'duller' ...lol rhymes with log. You're not going to say color. The second o in colour is never pronounced as the o in log.

    • @Pryen4
      @Pryen4 9 років тому +146

      The u in color is like the brown in between two colors, ugly and not needed

    • @Hubertus2224
      @Hubertus2224 9 років тому +1

      Innar Koït Chtofenbeurg AmE - color BE - colour

  • @NeoKobalt
    @NeoKobalt 8 років тому +17

    I FINALLY understand the purpose of lab color mode in Photoshop! thank you

  • @rhamph
    @rhamph 7 років тому +2

    Years of programming, including reading about gamma, and I never saw mention that both cameras and monitors used logarithmic scales, therefor all our beloved 8-bit image brightness is also on a logarithmic scale. "Gamma correction" is always portrayed as a funky post-processing effect to manipulate brightness, not an intrinsic step the monitor does to reverse what the camera did.

  • @priyamvadajain1513
    @priyamvadajain1513 7 років тому

    What a beautiful video.. and a beautiful observation. Well done minutephysics

  • @huntergrimx
    @huntergrimx 9 років тому +2069

    Ill add this to my giant list to why ios sucks

    • @TheSelphir
      @TheSelphir 9 років тому +77

      iOS really doesn't suck....iOS just serves a different purpose from Linux and Windows.

    • @yyunko7764
      @yyunko7764 9 років тому +174

      ***** Well iOS is basically a very expensive version of unix so...

    • @MrDerpHerp72
      @MrDerpHerp72 9 років тому +225

      Hunter Grimx This isn't limited to just iOS...

    • @Evolutionmine16
      @Evolutionmine16 9 років тому +290

      I think you missed the point of the video. It's not just iOS, it's the vast majority of computers. Every one needs to change, not just the OS you dislike.

    • @janisir4529
      @janisir4529 9 років тому +28

      ***** It's overpriced as fuck.

  • @heyitzrane3025
    @heyitzrane3025 6 років тому +14

    It's super easy for me to blend colors. All I have to do is take off my glasses! (BTW, I'm nearsighted.)

    • @ZaHandle
      @ZaHandle 3 роки тому +2

      Same all i need to do to blur the picture is steal your glasses

  • @hyattparkinson9430
    @hyattparkinson9430 6 років тому

    My sister works for Valspar Paint and creates her CH (Color Harmony) thoroughly through it. I love her!

  • @polychoron
    @polychoron 4 роки тому

    Thank you! I need this knowledge. Hope I'll remember how to do it when the time comes.

  • @RFalhar
    @RFalhar 9 років тому +7

    Holy shit. I consider myself a software developer with good understanding of image processing, but this is news for me.

  • @kraygarde.7325
    @kraygarde.7325 8 років тому +275

    is anyone else getting super bass in their headphones?

    • @thelennipede9382
      @thelennipede9382 8 років тому +174

      no i am not getting fish in my headphones. if you are, please see a doctor

    • @kraygarde.7325
      @kraygarde.7325 8 років тому +34

      lol that actually made me laugh

    • @auhng
      @auhng 7 років тому +14

      So you don't laugh at a fish very often.

    • @oM477o
      @oM477o 7 років тому +16

      I'm not really a fan of Nicki Minaj

    • @albertovicinanza
      @albertovicinanza 6 років тому +5

      Someone isn't using neutral headphones I see

  • @Epaminaidos
    @Epaminaidos 7 років тому

    Thank you! A few years ago, I had the exact same issue when trying to animate a color-change from red to green. And the library (jquery-ui) I used, added some dark gray in betwenn. Now I know the reason :)

  • @Orange_Tree_
    @Orange_Tree_ 4 роки тому

    O'kay, YT, I have absolutely no ideas why you are giving me four years old video, but this is actually bloody awesome one! Good job on making this, mate

  • @mikethunder84
    @mikethunder84 5 років тому +11

    ♥️"Shouldn't beauty be the default?"♥️

  • @GregoryTheGr8ster
    @GregoryTheGr8ster 8 років тому +234

    YES BEAUTY SHOULD BE THE DEFAULT! YES YES YES!

  • @oppenapple
    @oppenapple 4 роки тому

    Way to go Henry! Great analysis.

  • @camerongray7767
    @camerongray7767 4 роки тому +1

    Very good video, clear explanation and super helpful and interesting

  • @aurarus
    @aurarus 9 років тому +5

    This is the first time in a long time I could follow along holy shit

  • @RyanBottriell
    @RyanBottriell 8 років тому +41

    from a programming point of view though, blurring functions are already computationally heavy, and square roots are notoriously slow to process as well. I think we'd find that blurring images the correct way on devices like iOS with high pixel densities might actually produce upsetting lag in the interface. It's the kind of trade off that can be well worth it for the small number of people it might actually upset and teh small number of images it might mess up. IMO

    • @joeedh
      @joeedh 6 років тому +7

      That's what look up tables are for. :)

    • @purpleice2343
      @purpleice2343 6 років тому

      You have no fucking clue what a lookup table is.

    • @joeedh
      @joeedh 6 років тому +1

      No, I was not referring to the *blur*, but the gamma correction!

    • @benuscore8780
      @benuscore8780 6 років тому +6

      What Joe meant was a rainbow table. You only need a couple of megabytes to map one for every single color

    • @derrickmelton5844
      @derrickmelton5844 4 роки тому +2

      You literally pre-compute the inverse gamma curve and the normal gamma curve...multiply the working texels by the appropriate value of the inverse curve to get back to linear color space, blend, and multiply by the gamma curve to convert back to sRGB encoding....the curve is the same for each color channel too so you don't even have to waste memory pre-calculating for every possible color

  • @JP-sw5ho
    @JP-sw5ho 4 роки тому

    Thank you for this. I’ve always wondered

  • @sitioprueba2855
    @sitioprueba2855 6 років тому

    thank you for creating this!

  • @josh11735
    @josh11735 9 років тому +77

    How he got through this video without ever once mentioning that one digital picture (that shall not be named), I'll never know... ;P
    But seriously, very interesting video! :D

    • @Raicuparta
      @Raicuparta 9 років тому +5

      what image?

    • @josh11735
      @josh11735 9 років тому +8

      Raicuparta The image of a particular item of clothing :P

    • @unaliveeveryonenow
      @unaliveeveryonenow 9 років тому +63

      josh11735
      pfft, that fad lasted like 2 hours

    • @josh11735
      @josh11735 9 років тому +8

      cyberconsumer That's why it was a joke

    • @tubebrocoli
      @tubebrocoli 9 років тому +8

      it's actually more impressive how he did not mention the city lights picture from Nasa... scale it without converting to LAB colorspace first, and you get an image that's waaaay different.

  • @JohnArktor
    @JohnArktor 8 років тому +5

    Do you know the settings for this on gimp ? And btw, great video !

  • @DryLog420
    @DryLog420 5 років тому

    Wow... I never knew! Good videos keep em coming!

  • @tciddados
    @tciddados Рік тому +2

    Interesting, all this time I attributed this to thinking that the perception of color brightness was based on the highest color value (so, which RGB value is exciting our optic cones the most), and so blending red 255,0,0 and green 0,255,0 got a yellow 128,128,0 that appeared dull because its top end was only at 128, even if it had the same total # of photons (or so I thought). The more you know.

  • @fabriceneyret4267
    @fabriceneyret4267 7 років тому +36

    well, indeed it's not sqrt, but gamma transform ^1/2.2, or indeed it is sRGB transform that is more complicated. Ok, it can roughly be approximated by sqrt, but please don't say it IS sqrt. It's not more complicated to do the real math.

    • @mikhailmikhailov8781
      @mikhailmikhailov8781 5 років тому +8

      It doesnt particularly matter, sqrt is just a function that will space big values apart more than it will which is what the video wants to show. Introducing the actual real math there wouldnt serve to do anything, other than alienate the average viewer for no real reason. He puts an asterix for people like you as well

    • @dlwatib
      @dlwatib 4 роки тому +3

      What's the point of the video if not to be accurate?

    • @TristanBomber
      @TristanBomber 4 роки тому +12

      The video literally says this already at 2:01.

    • @totheknee
      @totheknee 3 роки тому +1

      @@dlwatib What is the point of your comment other than to imply that 2.0 is not in between 1.8 and 2.2 (which the video explicitly shows at 2:01)? This is not a rhetorical question.

  • @DonatoGreco
    @DonatoGreco 7 років тому +26

    if you REALLY want the Blur to use the correct Luminosity value, don't use RGB, but switch to LAB image mode (Image>Mode>Lab in Photoshop).
    Only there you will find the correct Luminosity applied to the color edges.

    • @Photosounder
      @Photosounder 7 років тому

      In Photoshop I set the image to 32-bits/channel mode, then it does the math right. Too bad many functions aren't implemented or poorly adapted to that mode.

    • @julianhugen8760
      @julianhugen8760 4 роки тому

      THANK YOU ALOT. I really wanted correct this because the blur effects I used to ajust ilummination in 3D render was getting a weird darkess. =D =D =D

    • @MatthijsvanDuin
      @MatthijsvanDuin 4 роки тому +2

      Using Lab is not more "correct", from a physics point of view using linear RGB is correct while Lab is wrong. However, Lab may very well _look better_ since the Lab color space is designed to model human perception.

    • @wesleymays1931
      @wesleymays1931 3 роки тому

      And from what I've seen, you can use it to adjust skin tones. (Flesh Man Group intensifies)

  • @Metzae
    @Metzae 7 років тому

    It's always great to understand what you intuitively know.

  • @boriscat1999
    @boriscat1999 6 років тому

    In display drivers development we end up converting to Linear RGB a lot through a de-gamma process to avoid a lot of the artifacts that occur when blending multiple layers. I wish I knew why a lot of software takes short cuts that look bad.

  • @darwinlp9860
    @darwinlp9860 8 років тому +4

    D: I had never considered there to be another possibility. Is there a good way to fix this in Photoshop?
    To be fair to us artists though, having it set this way probably makes it easier for us to transition from physical pigment mediums (paints, coloured pencils, anything of the sort) and better predict the results, since the mix of pigments produces darker, less saturated colours too. It's natural for us to understand the mixing of red and green (or any contrasting, complementary colours) as something that produces dark, desaturated brown. And the method you showed seems to have the problem of generating too much light between the colours, which could prove to be very tricky to deal with for, say, digital illustration. I'd have to test it myself.

    • @darwinlp9860
      @darwinlp9860 8 років тому

      Oh, sweet! I found the setting, and the gamma adjustment allows you to avoid the problem of too much brightness going on keeping the setting at ~1.5.

    • @harley1063
      @harley1063 8 років тому

      Wait, where's the setting? D:

    • @darwinlp9860
      @darwinlp9860 8 років тому

      +Foxeste You can see it briefly in the video. In Photoshop, click Edit > Colour Adjustments. A window opens up and there should be an option to "blend RGB colours using gamma", with an unticked box and a field where you can enter a number between 1-2,20 (1=most gammafied, 2,2=normal).
      (I have it in Spanish, so the wording might not be exact.)

  • @smutnejajo5149
    @smutnejajo5149 8 років тому +23

    Hmmm, now can you fix this in Inkscape?

    • @ZomB1986
      @ZomB1986 6 років тому +2

      Yes., Go to the XML editor, find the filter definition (under ), find the style attribute and remove the 'color-interpolation-filters' property from it (or delete it whole if it's the only property.)
      Remember that Inkscape can only do what SVG can, and probably less. More info:
      www.w3.org/TR/SVG/filters.html#FilterPrimitivesOverviewIntro

  • @aboutvenice
    @aboutvenice 6 років тому

    Most cleat explanation I ever seen. Thanks!

  • @chcodog1357
    @chcodog1357 7 років тому

    I didn't know how badly I wanted to know the reason behind ugly blurring.....Thank you!

  • @NiacinWaterTaffy
    @NiacinWaterTaffy 9 років тому +55

    Anybody know where the setting is for Gimp?

    • @WubbyPunch
      @WubbyPunch 9 років тому +35

      Dr. Certifiable somewhere underneath the leather suite.

    • @KavehMagaura
      @KavehMagaura 9 років тому

      sadly incorrect, just tested ^^

    • @NiacinWaterTaffy
      @NiacinWaterTaffy 9 років тому +1

      Blargles Malargles
      "Leather suite"...? Idk what that is but Kaveh is saying that's not right. Can you clarify?

    • @TheTopLogician
      @TheTopLogician 9 років тому +8

      Dr. Certifiable I think it has to do with BDSM. www.urbandictionary.com/define.php?term=gimp

    • @p.s.8171
      @p.s.8171 9 років тому +2

      Dr. Certifiable I think you have to search under Tools -> GEGL libraries -> gausian-blur, but I'm really not sure..

  • @Conformist138
    @Conformist138 8 років тому +18

    I'm interested in trying out the difference between these settings in photoshop, but even after I made the change shown in this video, photoshop appears to still blend the exact same way. Clicking that box hasn't altered any of the blending methods I've tested so far. Maybe I'm missing something and there's more to it than just clicking that box in the advanced color settings?

    • @Changderson
      @Changderson 8 років тому +1

      Same here :-/

    • @TaranVH
      @TaranVH 5 років тому +1

      his method will fix it for blending one layer on top of another one.
      To fix blurring one layer into itself, you have to use LAB mode rather than RGB.

    • @Wings012
      @Wings012 5 років тому

      Not sure if you ever figured it out but this is what I do to fix it:
      imgur.com/a/Ovc9bsJ

  • @C_Corpze
    @C_Corpze 3 роки тому +1

    Well this is useful info for when I make graphics and shaders in Blender and Unity.

  • @jelleh1462
    @jelleh1462 7 років тому

    i remember when this came out before i got into photoshop and ive remembered this video since

  • @Kamari333
    @Kamari333 8 років тому +4

    I totally agree with that last statement

    • @royvivat113
      @royvivat113 8 років тому

      What an insightful comment!

    • @vertgrip
      @vertgrip 8 років тому

      +Roy Vivat comments don't need to provide insight

    • @juneguts
      @juneguts 8 років тому

      What an insightful comment!

    • @johnalanelson
      @johnalanelson 6 років тому

      Did you even understand that last statement?

  • @BritishBeachcomber
    @BritishBeachcomber 4 роки тому +50

    That's why professional photographers always use "raw" image format. It preserves colour and brightness information correctly.

    • @ZaHandle
      @ZaHandle 4 роки тому +1

      jpeg sucks for quality

    • @banana_man_101
      @banana_man_101 3 роки тому

      So I accidentally turned on my translator and it messes up really often so showed a different comment and then this comment

    • @eness379
      @eness379 3 роки тому

      @@banana_man_101 ok

    • @SreenikethanI
      @SreenikethanI 3 роки тому

      @@banana_man_101 ok

  • @CactusFlowerSky
    @CactusFlowerSky 7 років тому

    Lovely explanation of how blur works, did not know that!

  • @kfjw
    @kfjw 7 років тому

    Part of this could be related to efficiency, since the Square Root operation is computationally intensive compared to multiplication and division... but still, I think we're at a point where the hardware can handle it pretty easily.

  • @gnagyusa
    @gnagyusa 8 років тому +3

    The proper thing to do, would be storing the exact response curves of the camera, with the image, so you can go back to "radiance-linear" (proportional to the number of photons that hit a sensor pixel) space, do blending etc., then re-apply the response.

    • @greenmumm
      @greenmumm 8 років тому

      Wouldn't that take up more space.

    • @gnagyusa
      @gnagyusa 8 років тому

      greenmumm It would be insignificant, compared to the image content.
      We are talking a table of a few hundred bytes, vs. megabytes for the pixel data.

    • @greenmumm
      @greenmumm 8 років тому

      lnpilot Right but that's why they didn't do that at first right?

    • @gnagyusa
      @gnagyusa 8 років тому +1

      greenmumm I guess, it's because you need relatively expensive equipment to acquire the camera's response curve, plus it takes some time.
      It would make sense for more professional cameras though...
      We have 3, $2000 high-end machine vision cameras for our robot project and they all have completely different responses (same sensor, same manufacturer!).
      So, I had to design / build a rig with a programmable, calibrated RGB light, to acquire the curves.
      It would be nice if the manufacturer did this and just stored the curves in the camera's firmware.

    • @greenmumm
      @greenmumm 8 років тому +1

      lnpilot Makes sense.

  • @Owen_loves_Butters
    @Owen_loves_Butters Рік тому +3

    2:53 Fun little thing to try to prove yourself (if you like math).
    (sqrt(x)+sqrt(y))/2

  • @sylv256
    @sylv256 3 роки тому

    good to know this. next time i make image editing software, i'll make sure to remember this

  • @kylebowles9820
    @kylebowles9820 4 роки тому

    Photographers that shoot in RAW keep the data linear so the default setting will work for them out of the box. Some image formats have flags to tell you what color space the data is in, they aren't used often enough. For games it's not easy to tell what gamma you should render to get it to show up accurately on the monitor. Image assets are usually saved in gamma space then blended linearly in the game engine, then converted to gamma space again, causing artifacts.

  • @Basedeath
    @Basedeath 8 років тому +9

    Well this answers why gradients with transparencies are so ugly in Illustrator.

  • @theJellyjoker
    @theJellyjoker 9 років тому +27

    The solution, don't use crappy tools.

    • @theotherguy181
      @theotherguy181 9 років тому +10

      Jeffery Liggett or learn how to use non crappy tools

    • @mr2octavio
      @mr2octavio 9 років тому +2

      Jason Crafts
      That's the correct way to define it.

    • @tubebrocoli
      @tubebrocoli 9 років тому +3

      ***** imageMagick 8D

    • @CraftThatBlock
      @CraftThatBlock 9 років тому +14

      ***** MS Paint.

    • @krisu0100
      @krisu0100 9 років тому +2

      Jeffery Liggett Don't use Adobe software......LOL

  • @KizulEmeraldfire
    @KizulEmeraldfire 8 років тому

    So, after a bit of experimentation in my copy of Photoshop CS6 Beta: going to Edit > Color Settings and checking "Blend RGB Colors Using Gamma" does nothing.
    BUT: all I have to do is go to Image > Mode, and select "Lab Color" - et voilà! When applying a Gaussian Blur filter to an image that's pure red on one side and pure green on the other, I get the gold color as displayed in this video, rather than 'dark sludge'. :D
    Thank you, MinutePhysics, for helping me out with this! …Even if it was indirectly! :)

  • @VIIflegias
    @VIIflegias 9 років тому +5

    yeah but.....will it blend?
    oh, yes. yes it does.

  • @RedsBoneStuff
    @RedsBoneStuff 7 років тому +3

    Audible, the leading provider of UA-cam sponsorship!

  • @Tondadrd
    @Tondadrd 4 роки тому

    I have to use this in one of my programming projects!

  • @veizour
    @veizour 4 роки тому

    Wow, never knew. Good lesson!

  • @Simawwn
    @Simawwn 8 років тому +3

    This is what a linear workflow does

  • @jknMEMES
    @jknMEMES 6 років тому +4

    2:34
    You missed the part where you draw red! xD

  • @arcy9289
    @arcy9289 6 років тому

    darn that explain why some drawing programs are better at blurring than others. didn't think of that

  • @bayraktarx1386
    @bayraktarx1386 6 років тому

    Working in Photoshop for 6 years now and learned something new today... thanks!!!

  • @KevboKev
    @KevboKev 8 років тому +29

    +MinutePhysics videos are probably the only UA-cam videos that fuck with my sub, playing a bass line at a frequency it does not like! Grrrrrrrrrrrrrrrrr

    • @theLuigiFan0007Productions
      @theLuigiFan0007Productions 8 років тому +1

      That must be annoying, I completely know that feeling. Where something has an odd harmonic that creates a low growling or distorting sound. Wonder what it is. Our town's radio station has a imbalance of 15% on the stereo channels and that already drives me crazy. My right ear is happy, the left one is sad. XDDD
      Maybe I should email them, I noticed it isn't as bad on stereos as portable devices like phones and MP3 players. Perhaps nobody even knows it does that. Though I do find old analog broadcast hardware quite cool, they have quirks from time to time that's for sure. :D

    • @firefly618
      @firefly618 7 років тому

      +theLuigiFan0007 have you tried listening to that station with different radio equipment and/or in different locations? Stereo FM transmission is not trivial. It starts by transmitting the sum L+R, to be compatible with non-stereo receivers, then computes the difference L−R, uses it to amplitude modulate a higher frequency signal, called a Subcarrier, then merges it back with the main signal.
      What I mean is that there may be some interference in your specific location and/or a fault in your own equipment that gives that imbalance. It may or may not be the station's fault. This is also one of the reasons most stereo equipment (used to?) have a Balance knob, to tweak the stereo balance manually.

    • @theLuigiFan0007Productions
      @theLuigiFan0007Productions 7 років тому

      etatoby
      Yeah I know how stereo broadcast works to some extent, isn't the MPX subcarrier between 19kHz to 39kHz?
      Could be interference, as the roof is a steel roof, which is made of enameled steel plate. But, I don't think so as if I use a USB SDR stick or a car radio there's no imbalance. Both of those auto adjust stereo balance, as far as I know.
      Could just be older receivers don't like the signal output by the station. I tried it on a somewhat decent stereo a while back and it sounded fine as well. I think the problem is limited to cheap FM radios.

    • @walterbrokx8112
      @walterbrokx8112 6 років тому

      Maybe you need to use advanced settings ;)

  • @Azurren
    @Azurren 9 років тому +12

    Wouldn't this just create a new problem for any image *not* taken with a digital camera?
    Are do all current image containers utilize the same squaring algorithms?
    _Example, an image created solely in Photoshop_

    • @Sebastian-hg3xc
      @Sebastian-hg3xc 9 років тому +21

      It's not about whether you took the image with a digital camera. It's about the format you store it. Even when you create images in photoshop and then save them as JPG or whatever format Henry is talking about, they will be stored the same way as digital photos.

    • @DexLuther
      @DexLuther 9 років тому

      ***** I would assume that formats that are considered less "lossy" and less compressed would avoid this or at least minimize the effects. Such as saving as PNG instead of JPG

    • @SerahAndTheGamerverse
      @SerahAndTheGamerverse 9 років тому +3

      ***** From a editing standpoint, you should always work with RAW image. The quantity of information it contain REALLY does make a difference. However, even when working with RAW, trying to blur something using RBG does gave you the same dark effect we try to avoid. The LAB color space, as far as I could say, is really the only thing that have a significant impact on this. After all, it doesn't mater how much data you have for an Image if, to begin with, the way the data is altered (editing) is wrong and this is exactly the problem we have here. The problem is not the data, it is the way your program (ex:Photoshop) modify the said data.

    • @rrrrrrrrrrrrrrrrrrrrr
      @rrrrrrrrrrrrrrrrrrrrr 9 років тому +5

      All images created for display in the web are created in the sRGB color space, and therefore follow the sRGB gamma curve (roughly a power of 2.2, not technically "squared"). This is so that they don't need modification in order to be displayed by web browsers. JPEG files are generally assumed to be in sRGB, and this is what the average image editor will assume as well.
      PNG files actually have a gamma and color profile setting so you can store it with any gamma curve you want, but many web browsers and image viewers still horribly suck at proper color management.

  • @lksxxtodin5292
    @lksxxtodin5292 11 місяців тому

    Que vídeo bom! Agora sim eu entendi sobre Gamma

  • @rzeka
    @rzeka 4 роки тому

    This is a really good video, I can't believe I've never seen it before

  • @GuillaumeVerdonA
    @GuillaumeVerdonA 8 років тому +5

    Ah the triangle inequality, so useful

  • @hyperthreaded
    @hyperthreaded 9 років тому +10

    The thing is, it's arguably bad design to do this gamma correction *during color blending/blurring* in each application via a setting. That may be why even knowledgeable programmers are reluctant to do it, let alone enable it by default. It *should* be done when *reading* the image file, then all the mixing and blending should be done linearly, and then the reverse gamma correction should be applied to the result. Doing gamma correction during color blending would also make the program run slower -- color blending is often done on the GPU these days, and the hardware color blender even in modern GPUs is "fixed-function", i.e. it isn't freely programmable, it's only somewhat parameterizable, and it can only do linear blending (see www.opengl.org/sdk/docs/man/html/glBlendFunc.xhtml). You can do arbitrary non-linear blending in a pixel shader (a small user program that is run by the GPU in parallel for each pixel of the frame to compute its color), but that's still slower than the fixed-function blender, and it may require a large refactoring of your rendering pipeline code, so you may not be able to do that easily.
    As mentioned, the right way to solve this problem is to apply ^(1/Gamma) to all pixel values of an input image as you're reading it, since common image formats like JPEG have already been gamma-corrected during creation, i.e. their pixel values correspond to (physical light intensity of the pixel)^Gamma. Then you would do all the color mixing and blending linearly, and then apply ^Gamma once to the final result pixel right before sending it to the display hardware -- which internally computes ^(1/Gamma) to get the actual physical brightness of the pixel on the display (this was due to physical properties of the screen on CRTs, and modern LCDs emulate it for backwards compatibility).
    This is all supported in hardware these days: the sRGB texture format (since OpenGL 2.1) takes care of the gamma correction when reading images -- i.e. it computes texture value = (image pixel value)^(1/Gamma) when reading an image into a texture. Then you can blend multiple texture values linearly, i.e. just add/average them to obtain the result pixel which you write into the framebuffer. After that, the sRGB framebuffer format (GL_FRAMEBUFFER_SRGB, sine OpenGL 3) takes care of computing output pixel value = (framebuffer pixel value)^Gamma, which is sent to the display. I don't know which part of that pipeline common tools like Photoshop or GIMP get wrong (I'm not really an expert on this stuff either), but the solution proposed here ("Blend RGB colors using Gamma" setting in Photoshop) is not optimal.

    • @marcan42
      @marcan42 6 років тому

      That's not true. Desktop GPUs have fixed-function blending. Shaders are for pixel generation during rendering, but the blending process that puts those pixels onto the framebuffer is still fixed-function. This is actually programmable on some mobile GPUs which use tile-based rendering, but desktop GPUs do not have this feature. You can simulate arbitrary blending by using more complicated shader programming, but it makes everything a lot more complicated and slower (in some cases impractically so).
      Olaf is correct. Gamma correction should be considered a *file encoding* detail. In fact it's almost the same as a-law and mu-law audio encoding, and nobody is dumb enough to try to do audio processing with a-law and mu-law data. We just do it with video/graphics because we're used to doing it wrong.
      GIMP 2.9 (devel) does this properly. Its image operations all use linear 0-1 values. The working image can be internally stored in any format in memory, and in case of gamma-encoding it will be converted to linear light before any operations are performed. For ideal precision across multiple operations, you should change the image mode to 32-bit float linear, work on it, then only export to sRGB the final image. But even without doing that, operations will be correct (though you may lose a bit of precision due to intermediate conversions).

  • @Marina-nt6my
    @Marina-nt6my Рік тому +1

    3:06 you know how many art tutorials there are that tell you to brighten mid tones and blended color areas with arbitrary fake reasons? Sometimes ambient occlusion and subsurface scattering are terms thrown into it, when it's actually just this^ sometimes.

  • @luck3949
    @luck3949 4 роки тому

    Wow, I never heard about it! Even though I am pretty advanced in computer vision (did vSLAM diploma project, and almost got a computer vision engineer position).

  • @DaviddeKloet
    @DaviddeKloet 9 років тому +9

    I had no idea! Is the same true for the alpha channel in semi-transparent "colors"?

    • @NikZherebtsov
      @NikZherebtsov 9 років тому

      Nice!

    • @alknowshow
      @alknowshow 9 років тому

      Yup!

    • @MarekMaterzok
      @MarekMaterzok 9 років тому +1

      Yes, the alpha channel has the same problem. Do the following experiment:
      1) Create a new image in Gimp, filled with red.
      2) Create a new layer, half-filled with green.
      3) Gaussian-blur the green layer.

    • @MarekMaterzok
      @MarekMaterzok 9 років тому

      I'm beginning to think that framebuffers should be using floating point numbers representing luminances in CIE color space and converted to monitor color space for display by the graphics card. That would make doing the Right Thing so much simpler.