View Full Version : Color dodge eliminate yellowing. Why? dario 03-08-2006, 02:48 AM Hi, it's me again with my comics restauration hobby.
I just discovered a nice trick to eliminate automatically the yellowing of the old pages, but i do not understand why it works. Can you explain it ?
Here is the trick
When you have a yellowed comic page (first image) create a new layer filled with the color of the paper (that supposedly was almost white at the origin).
Now invert the layer, and use Color Dodge as blending mode. The result is a restored page (second image)
I would like to understand why it works. What EXACTLY the color dodge blending mode does? I really would like to understand the math behind it (i'm good with math so don't worry :) )
thank Dario Dario,
If that was Linear Dodge, and not Color Dodge, the formula would have been very simple. Linear Dodge is the simplest blend of all - just add the values of each channel.
In your "trick", sampling the (supposedly) white border gives a reading of around 251/241/184.
Inverting that, gives you the difference from 255 in each channel - or 004/014/071.
Adding that (if it were Linear Dodge) (not surprisingly) gets you back to 255 in each channel. The rest of the image will be brighter (because we're adding) and bluer, or less yellow (because the blue value is higher).
There is a very much simpler techique that gives the same result as the Color Dodge trick. Make a levels adjustment layer, select the White eye-dropper and click on the (supposedly) white border.
This gives exactly the same result as the Color Dodge. (and after some exploration should explain the math(s) behind it).
Rô mistermonday 03-08-2006, 08:48 AM Dario, a good explanation by Ro.
ColorDodge brightens the backdrop color to reflect the source color. Painting with black produces no changes.
FYI, the math formula for Color Dodge is as follows:
B(cb,cs) = { Min (1, cb/(1-cs)) if cs<1
1 if cs=1
Where cb is the background color and cs is the source color
Regards,
Murray Thanks Murray. :bigthmb:
I searched (and searched) and didn't discover that! Where did you get that from? Must be interesting reading (for Geeks :cool: ).
Re-writing for (normal) channel values gets...
Min(255, b * 255/(255-a))
(adding or subtracting some 1's here and there because channel values start at 0)
By symmetry, I also got the Color Burn formula...
Max(0, 255*(1 - (255- b)/a)))
(0 for a=0)
Now I am one happy Geek!
Murray, now where did you find that?
Rô dario 03-08-2006, 11:22 AM B(cb,cs) = { Min (1, cb/(1-cs)) if cs<1
1 if cs=1
Thanks!
Do you have the formula for all the other blending modes too ?
Dario Cameraken 03-08-2006, 11:32 AM Here is a link.
Look under 'Burn Modes'
http://www.pegtop.net/delphi/blendmodes/
Ken Thanks Ken,
update for the link - http://www.pegtop.net/delphi/articles/blendmodes/
Seems that a bigger problem than understanding the formula is trying to describe it.......
This mode is some kind of inverted multiply mode (the multiplication is replaced by a division of the "inverse"). :eek: :dizzy: :knockedou
Rô Cameraken 03-08-2006, 12:41 PM You are Welcome.
Here is another.
http://www.vanderlee.com/tut_fm_mixingmodes.html
Ken. Flora 03-08-2006, 01:27 PM Hi dario!
Welcome to RP! :pleased:
For all the others....
:bawling: :bawling: :bawling: ...that's really IT! .... I've had it .... I'm going to pick up knitting as a hobby!!!! ;) ;) Kraellin 03-08-2006, 02:18 PM now flora, dont do that or we'd all have to take up knitting as well just to try and do as well as you do ;)
craig dario 03-08-2006, 02:27 PM Hi dario!
Welcome to RP! :pleased:
Ciao Flora, grazie
For all the others....
:bawling: :bawling: :bawling: ...that's really IT! .... I've had it .... I'm going to pick up knitting as a hobby!!!! ;) ;)
Am I missing something? :happy: Flora 03-08-2006, 02:41 PM Ciao Dario!!!
Am I missing something? .... Not really :pleased: ... Fact is that I'm an absolute disaster with numbers .... and feel a bit frustrated when exposed to the knowledge of the 'numbers' geniuses we have here ...
P.S. ... probabilmente verrò condannata al rogo per questo!!! :D :D
P.P.S. ... di dove sei? Flora 03-08-2006, 02:44 PM Craig,
:lol: :lol: :lol: .... [B] I'm going to pick up knitting as a hobby!!!! ;) ;)
Flora, if you need help, just let me know. I quit Photoshop, and took up knitting about 6 months ago. Maybe Doug will add a knitting forum. ;)
Dario, welcome to RP!
Ed Flora 03-08-2006, 02:54 PM Flora, if you need help, just let me know. I quit Photoshop, and took up knitting about 6 months ago. Maybe Doug will add a knitting forum. ;) :lmao: :lmao: :lmao: :lmao:
... I will ask Doug about the knitting Forum .... and will be kicked out of RP at the speed of light!!!! :lmao: Have you seen those knitting patterns? :devil: :confused: :eek: :cold:
What's a teeny cute little color dodge formula :hairbow: in the face of one of those monsters?
But just to hedge my bets - "Can we have an absolute beginners knitting forum?"
Rô Flora 03-08-2006, 04:24 PM What's a teeny cute little color dodge formula :hairbow: .... :eek: :ogre: :confused: :jacko:
But just to hedge my bets - "Can we have an absolute beginners knitting forum?" Thank Rô .... I just knew I could count on you!!!! :bigthmb: :lmao: .... Gary Richardson 03-09-2006, 01:48 AM OK, so who's Moderating this Knitting Forum?
What's a teeny cute little color dodge formula in the face of one of those monsters?
Ro, seems you're ideal for the job, it'll help you with your obviously dodgy maths skills. (He says with tongue boring hole in cheek).
I can just about manage a scarf, and can count to 20 only if I take off my shoes and socks. :grin: :grin: :grin: ....and can count to 20 ...I can't even do that - when I get to 11 the next number that comes up is 100. :square:
:D :D
Rô Kraellin 03-09-2006, 06:52 AM actually, Ro, knitting is kind of a binary action. you'd be perfect for it. writing actions for it might be a bit difficult though.
craig |