"Garry R. Osgood" wrote: > Tor Lillqvist wrote: > > > I think it is time to repeat this message, from a year ago... The same > > strange-looking code is still present in color_transfer.c. Is it a > > bug? Should it be fixed before 1.2? Is my suggestion below a good one? > > > > <snipped...> > > > Comments, please? > > > > --tml > > I believe you are correct. Shadows ought to be handled differently. <snipped...> And, in Gimp 1.1.18, Shadows *ARE* handled differently - the highlighted code posted this AM has to be contemplated a bit. The computational stuff on the right hand side defines two "half" transfer functions; lets call one A and the other B. (and B seems to be inadvertently used twice). But note that each line of code is making *two* assignments in what may be regarded as two halves of two transfer functions, so that the array pairs: highlights_add + highlight_sub defines "highlight transfer function" and is A + B midtones_add + midtones_sub defines "midtone transfer function" and is B + B shadows_add + shadows_sub defines "shadow transfer function and is B + A So the four "half transfer functions" B and the two "half transfer functions" A are permuted in different ways to make three "full transfer functions" A + B, B + B, and B + A. These are actually proto transfer functions that get finalized when actual settings from the color balance GUI come into play. Are these transfer functions the greatest thing since sliced bread? Might not degree two bezier polynomials offer better smoothness? I don't know -- the issue kind of has become moot for me personally now that the code seems less broken than what a casual glance suggested this morning. I think Carey Bunks has already made the capstone observation, elsewhere: the balance tool is fully and comprehensively superceded by the curve tool, and once one gets the hang of curve tool subtleties, the "semi-hard-coded" transfer functions in the balance tool, just don't offer enough flexibility. If the balance tool offers anything at all, it is a limited subset of curve tool functionality with an intuitively more accessible interface - a bicycle with training wheels. When one moves onto the curve tool, they shed the training wheels and never look back. At least in my humble opinion. So I contradict myself from this morning. This is not a bug, To give you a sense that GIMP shadows are balanced differently than midtones, I present color pixel samplings done across 16 tones of grey, and then subjected to some "color balancing" to extreme yellow. Unadorned data set of color picker samples R G B 0 0 0 17 17 17 34 34 34 51 51 51 68 68 68 85 85 85 102 102 102 119 119 119 136 136 136 153 153 153 170 170 170 187 187 187 204 204 204 221 221 221 238 238 238 255 255 255 Photoshop 3.0 on SGI (a very old photoshop) midtone. preserve luminosity. The blue/yellow slider was pulled all the way over to yellow, giving r = 0, g = 0, and b = -100 0 0 0 37 37 6 61 61 15 81 81 26 100 100 40 117 117 54 133 133 70 148 148 87 163 163 105 178 178 124 191 191 144 205 205 165 218 218 186 230 230 208 243 243 231 255 255 255 Gimp 1.1.18 on SGI (a very new GIMP) midtone. preserve luminosity. The blue/yellow slider was pulled all the way over to yellow, giving r = 0, g = 0, and b = -100 R G B 0 0 0 34 33 0 62 61 5 88 87 14 111 110 24 131 130 38 149 148 54 165 164 72 174 173 97 179 179 126 192 191 147 205 205 168 219 218 189 231 231 210 243 243 232 255 255 255 Photoshop 3.0 on SGI SHADOW. preserve luminosity. The blue/yellow slider was pulled all the way over to yellow, giving r = 0, g = 0, and b = -100 R G B 0 0 0 17 17 0 34 34 0 51 51 0 68 68 0 85 85 0 102 102 3 119 119 31 136 136 59 153 153 87 170 170 115 187 187 143 204 204 171 221 221 199 238 238 227 255 255 255 GIMP 1.1.18 SHADOW, prereserve luminosity, blue/yellow slider 100% (-100 adjustment on blue) R G B 0 0 0 34 33 0 68 67 0 102 100 0 136 134 0 170 168 0 198 195 6 200 198 37 200 199 71 198 197 107 201 200 138 213 213 160 226 226 181 238 238 203 248 248 227 255 255 255 Both products behave roughly the same, but clearly have differently behaving transfer functions at work. Probably should have woke up earlier and looked at things this AM. Be good, be well Garry