Very good analysis, Jim. If those routines are still around it wouldn't be too hard to implement Luke's idea below with a natural image, would it? ;-)
Not too hard. There are three obstacles, all probably surmountable.
The first is that I'm hard at work on my book and the new synthetic slit scan project.
The second is that it'll take me a while to remember how to set up the scripts to do the processing. You've seen my Matlab code. While I subscribe to the theory that a computer program is a communication with those who will come after and only incidentally with the computer that will run it, I never seem to be able to turn that maxim into practice.
The worst example I ever saw of this was thankfully not written by me. When I worked at hp, there was a bug in a 2116A ADC driver. I took a look at the code. It was written in assembler, which needs comments more than Matlab. There were pages of commentless code. Finally I saw a comment next the the instruction CMA,INA, which complements the A register and increments the result by one. The comment, repeated here in its entirety, was, "Make A negative."
The fact that the companding code is embedded in the camera simulator means there's more code to re-understand. It shouldn't take very long, but it's my least favorite programming task.
The third is finding a good candidate image. And that raises the Clintonian question, since which image would be good depends on the definition of good in this context. Is a good image one that will show a big difference after companding? Just what are we trying to discover/prove here?
I could use some help with that last one.
Jim