Gamma dilemma

PE
Posted By
phoney.email
Apr 18, 2004
Views
567
Replies
6
Status
Closed
Converting from gamma 1.00 to 2.20 causes serious histogram artifacts. This is manifested by recursive and overlapping "waves" with major gaps in the lower (dark) part of the histogram as can be seen here:

http://members.aol.com/tempdon100164833/nikon/Blue.jpg
http://members.aol.com/tempdon100164833/nikon/Green.jpg
http://members.aol.com/tempdon100164833/nikon/Red.jpg

Editing an image with such major histogram distortion is quite difficult if not impossible.

Question: Is there any way to do a gamma conversion and still end up with a smooth and uniform histogram?

Don.

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

BV
Bart van der Wolf
Apr 18, 2004
"Don" wrote in message
Converting from gamma 1.00 to 2.20 causes serious histogram artifacts. This is manifested by recursive and overlapping "waves" with major gaps in the lower (dark) part of the histogram as can be seen here:
http://members.aol.com/tempdon100164833/nikon/Blue.jpg
http://members.aol.com/tempdon100164833/nikon/Green.jpg
http://members.aol.com/tempdon100164833/nikon/Red.jpg

Editing an image with such major histogram distortion is quite difficult if not impossible.

Question: Is there any way to do a gamma conversion and still end up with a smooth and uniform histogram?

Other than with a cosmetic trick, 8-b/ch gamma 1/1.00 to 1/2.20 cannot produce a continuous histogram in 256 bins. The resulting posterization (gaps in the shadows and loss of color resolution in the highlights) can be cosmetically covered up e.g. by adding noise, or subsequent color balancing in 16-b/ch mode.

A better approach is by preventing the need for such a kludge (which only adds data but no information), scan and gamma process in 16-b/ch mode (if the actual data has between 8 and 16-bits real information) before reducing to 8-b/ch.

Bart
PE
phoney.email
Apr 19, 2004
On Sun, 18 Apr 2004 11:50:13 +0200, "Bart van der Wolf" wrote:

Question: Is there any way to do a gamma conversion and still end up with a smooth and uniform histogram?
….
A better approach is by preventing the need for such a kludge (which only adds data but no information), scan and gamma process in 16-b/ch mode (if the actual data has between 8 and 16-bits real information) before reducing to 8-b/ch.

The problem is I only get 8 bits from the scanner.

I guess the only other alternative is to work in linear gamma and do the conversion as the last step.

Don.
W
westin*nospam
Apr 19, 2004
(Don) writes:

On Sun, 18 Apr 2004 11:50:13 +0200, "Bart van der Wolf" wrote:

Question: Is there any way to do a gamma conversion and still end up with a smooth and uniform histogram?

A better approach is by preventing the need for such a kludge (which only adds data but no information), scan and gamma process in 16-b/ch mode (if the actual data has between 8 and 16-bits real information) before reducing to 8-b/ch.

The problem is I only get 8 bits from the scanner.

But is it linear? Linear 8-bit isn’t very useful. If you can only get 8 bits, it’s probably better to get gamma-corrected info from the scanner.

I guess the only other alternative is to work in linear gamma and do the conversion as the last step.

Maybe. The problem, of course, is that where you stretch contrast in the darker areas, there just isn’t enough information to fill in the histogram. If you’re seeing waves instead of isolated spikes, Photoshop is dithering to reduce banding effects, which is A Good Thing. Perhaps you could try upsampling the image by 4x or so with Bicubic interpolation, which would introduce some intermediate levels, then downsample (all in 16-bit mode). This will add more levels in a way that might be reasonable.


-Stephen H. Westin
Any information or opinions in this message are mine: they do not represent the position of Cornell University or any of its sponsors.
PE
phoney.email
Apr 19, 2004
On 19 Apr 2004 09:40:47 -0400, westin*
(Stephen H. Westin) wrote:

(Don) writes:
A better approach is by preventing the need for such a kludge (which only adds data but no information), scan and gamma process in 16-b/ch mode (if the actual data has between 8 and 16-bits real information) before reducing to 8-b/ch.

The problem is I only get 8 bits from the scanner.

But is it linear? Linear 8-bit isn’t very useful. If you can only get 8 bits, it’s probably better to get gamma-corrected info from the scanner.

Nikon LS-30 here, so it’s 10 bits internal, but only 8 bits external. And what I’m getting from the scanner is pretty bad:

http://members.aol.com/tempdon100164833/nikon/Blue.jpg
http://members.aol.com/tempdon100164833/nikon/Green.jpg
http://members.aol.com/tempdon100164833/nikon/Red.jpg

I tried scanning at gamma 1.00 and applying corrections (to convert to
2.20) in Photoshop and that produces an image with a totally different
histogram. Apparently PS (version 6 here) must use a different gamma algorithm!? Still, lots of gaps in the dark areas, of course.

I guess the only other alternative is to work in linear gamma and do the conversion as the last step.

Maybe. The problem, of course, is that where you stretch contrast in the darker areas, there just isn’t enough information to fill in the histogram.

Bingo! That’s the problem. I’m also trying to contrast mask to extend the dynamic range of the scanner (pesky Kodachromes) and that’s pretty much impossible with a "Swiss cheese" histogram.

If you’re seeing waves instead of isolated spikes,
Photoshop is dithering to reduce banding effects, which is A Good Thing.

!!! That answers my question above why NikonScan histogram looks different than Photoshop’s when doing the same thing (gamma conversion from 1.00 to 2.20)!

Perhaps you could try upsampling the image by 4x or so with Bicubic interpolation, which would introduce some intermediate levels, then downsample (all in 16-bit mode). This will add more levels in a way that might be reasonable.

My intention was to, indeed, use 16-bit for editing but I wanted to figure out this histogram problem first. However, now that you mention it, I’ll give it a try.

BTW, a while back I stumbled across something similar myself. I inadvertently turned on interpolation in NikonScan (long story, it’s an NS bug, has to do with cropping) and the result was a smooth histogram until I discovered that the image was interpolated (resulting in softening of the image).

Don.
ME
Mike Engles
Apr 22, 2004
Don wrote:
On 19 Apr 2004 09:40:47 -0400, westin*
(Stephen H. Westin) wrote:

(Don) writes:
A better approach is by preventing the need for such a kludge (which only adds data but no information), scan and gamma process in 16-b/ch mode (if the actual data has between 8 and 16-bits real information) before reducing to 8-b/ch.

The problem is I only get 8 bits from the scanner.

But is it linear? Linear 8-bit isn’t very useful. If you can only get 8 bits, it’s probably better to get gamma-corrected info from the scanner.

Nikon LS-30 here, so it’s 10 bits internal, but only 8 bits external. And what I’m getting from the scanner is pretty bad:

http://members.aol.com/tempdon100164833/nikon/Blue.jpg
http://members.aol.com/tempdon100164833/nikon/Green.jpg
http://members.aol.com/tempdon100164833/nikon/Red.jpg

I tried scanning at gamma 1.00 and applying corrections (to convert to
2.20) in Photoshop and that produces an image with a totally different
histogram. Apparently PS (version 6 here) must use a different gamma algorithm!? Still, lots of gaps in the dark areas, of course.
I guess the only other alternative is to work in linear gamma and do the conversion as the last step.

Maybe. The problem, of course, is that where you stretch contrast in the darker areas, there just isn’t enough information to fill in the histogram.

Bingo! That’s the problem. I’m also trying to contrast mask to extend the dynamic range of the scanner (pesky Kodachromes) and that’s pretty much impossible with a "Swiss cheese" histogram.
If you’re seeing waves instead of isolated spikes,
Photoshop is dithering to reduce banding effects, which is A Good Thing.

!!! That answers my question above why NikonScan histogram looks different than Photoshop’s when doing the same thing (gamma conversion from 1.00 to 2.20)!

Perhaps you could try upsampling the image by 4x or so with Bicubic interpolation, which would introduce some intermediate levels, then downsample (all in 16-bit mode). This will add more levels in a way that might be reasonable.

My intention was to, indeed, use 16-bit for editing but I wanted to figure out this histogram problem first. However, now that you mention it, I’ll give it a try.

BTW, a while back I stumbled across something similar myself. I inadvertently turned on interpolation in NikonScan (long story, it’s an NS bug, has to do with cropping) and the result was a smooth histogram until I discovered that the image was interpolated (resulting in softening of the image).

Don.

Hello

The Ls30 only delivers true images at 2700 and 1350 dpi.All resolutions in between are interpolated.

I assume the same from my LS50,2000and 4000dpi.

I have to say that you are really flogging a dead horse, trying to get good scans from a LS30 and darkish Kodachromes. It cannot be done. It is a problem with my LS50 and that is 14 bit. Dark Kodachromes are no good in Nikon scanners. My Epson 4870 gives better results. It has to be the type of illumination.

Well exposed Kodachromes are fine on a LS50. I do have a lot of underexposed ones.

Mike Engles
PE
phoney.email
Apr 23, 2004
On Thu, 22 Apr 2004 23:09:42 +0000 (UTC), Mike Engles
wrote:

The Ls30 only delivers true images at 2700 and 1350 dpi.All resolutions in between are interpolated.

The resolution is 2700 but it was an NS bug. I used fixed cropping and this was displayed in both "Keep this crop" and "Keep this output size" (the *same* values).

However, internally, NS used *different* values less than a pixel worth so it didn’t show up on the display, but there was a minute difference nevertheless. This resulted in "hidden" interpolation.

I have to say that you are really flogging a dead horse, trying to get good scans from a LS30 and darkish Kodachromes. It cannot be done. It is a problem with my LS50 and that is 14 bit. Dark Kodachromes are no good in Nikon scanners. My Epson 4870 gives better results. It has to be the type of illumination.

Once I turned off Nikon Color Management things improved a lot. I’m getting very good results with Analog Gain and contrast masking. It’s a lot of work, though.

Don.

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

Related Discussion Topics

Nice and short text about related topics in discussion sections