3 ms·
I basically mean clipping the diffused error - for example if I propagate a positive error to a pixel that is already white, and don't propagate that error agai
by vanderZwan 7y ago
I basically mean clipping the diffused error - for example if I propagate a positive error to a pixel that is already white, and don't propagate that error again to the next pixels.
In the linked notebook, I use a separate error array made out of Int32 values (which is probably overkill, Int16 would suffice) and postpone division until the last moment. It's a small detail but it makes a significant difference in the hybrid output.
- mark-r 7y agoError is error, it would never have occurred to me to clip it. I can see how that would make a big difference.
- vanderZwan 7y agoMe neither, but it doesn't even have to be a conscious choice! Let's you want to implement an in-place algorithm to save memory (which I'm presume was a realistic trade-off to consider back in the early eighties), and your inputs are single bytes for each channel, then your only option is to do saturating arithmetic. Clipping just falls out of that as a side-effect.