b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » Message 10677274 (Thread)

# Not that simple
(, Tue 31 Jan 2012, 21:24, archived)
# Sure, but even the basic average method produces a tolerable image, not one apparently covered in mildew spots
See this section of the image from the big screen above?

See the dark part in the middle, that looks vaguely like a peeled banana? In the original, that has red value 173 (and zeroes in the other channels). See the light pixels surrounding it? In the original, those have red value 172 (and zeroes in the other channels). The only difference in the input is the least significant bit, but the difference in the output is really big.
(, Tue 31 Jan 2012, 21:40, archived)
# Hmm
Maybe wraparound? Depending on how the values are handled, a value of 258 can end up as 2 (258-255). Hard to say without getting into the guts of the code.
(, Tue 31 Jan 2012, 23:07, archived)
# Yes, I was thinking that, integer overflow
except there's no good reason for an overflow to occur at that boundary between 172 and 173, unless there's something scaling the 172 up to some 2^N-1, and though I fiddled around with the calculator for ages I couldn't find any reasonable way for that to happen. To get the 255/256 boundary you have to scale them both up by around 1.48; so that doesn't seem to mean anything. If you multiply by three, they just miss the 511/512 boundary: 172*3 is 516. Maybe *3 and then minus 5? Why, though?
(, Tue 31 Jan 2012, 23:53, archived)
# This is getting far too geeky
The only thing I could think of was bad handling of signed/signed bytes. Then you get wraparound/overflow at 127. Java did it to me a lot when I ported a bunch of my old c/c++ code (the bastard, *shakes fist*).

[edit] Using the luminance algorithm, 173 * 0.72 is 124(ish), which is pretty close to the boundary.

[editedit] Except 0.72 is the factor for the green channel. Fucksocks!
(, Wed 1 Feb 2012, 0:40, archived)