Compressing/Expanding dynamic range

PE
Posted By
phoney.email
Jul 5, 2004
Views
549
Replies
13
Status
Closed
I’d like to arbitrarily compress/expand different areas of dynamic range. Best explained with the histogram.

Let’s say I’d like to expand the range 0-150 to span 0-200, and conversely, compress the dynamic range 150-255 into 200-255.

In other words, imagine a marker at 150. I’d like to be able to move that marker to 200 expanding/compressing relevant portions of dynamic range as needed.

In a (weird, inverse) way the gamma slider in Levels does that, but not only is it "reverse logic" but it’s limited to a single point and it’s also a fixed point.

I’ve been playing around with curves with some success but was just wondering if anyone else has any thoughts on this.

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.

PW
Pjotr Wedersteers
Jul 5, 2004
"Don" wrote in message
I’d like to arbitrarily compress/expand different areas of dynamic range. Best explained with the histogram.

Let’s say I’d like to expand the range 0-150 to span 0-200, and conversely, compress the dynamic range 150-255 into 200-255.
In other words, imagine a marker at 150. I’d like to be able to move that marker to 200 expanding/compressing relevant portions of dynamic range as needed.

In a (weird, inverse) way the gamma slider in Levels does that, but not only is it "reverse logic" but it’s limited to a single point and it’s also a fixed point.

I’ve been playing around with curves with some success but was just wondering if anyone else has any thoughts on this.

Don.

If I see this correctly, curves is exactly the tool for this. If you put a marker at 150 and lift that to 200 (check input & output numbers) you will have expanded the 0-150 region to 0-200 at the cost of the 150 – 255 region, which now resides in the 200-255 region. I tried it and the resulting curve is not too extreme. Of course it all depends a lot on the picture whether the result is nice…

Is there something else you want to achieve then ?
HTH
Pjotr
PE
phoney.email
Jul 6, 2004
On Mon, 5 Jul 2004 19:57:12 +0200, "Pjotr Wedersteers" wrote:

"Don" wrote in message
I’d like to arbitrarily compress/expand different areas of dynamic range. Best explained with the histogram.

Let’s say I’d like to expand the range 0-150 to span 0-200, and conversely, compress the dynamic range 150-255 into 200-255.

If I see this correctly, curves is exactly the tool for this. If you put a marker at 150 and lift that to 200 (check input & output numbers) you will have expanded the 0-150 region to 0-200 at the cost of the 150 – 255 region, which now resides in the 200-255 region. I tried it and the resulting curve is not too extreme. Of course it all depends a lot on the picture whether the result is nice…

That’s what I have been doing, but I observed that (due to inherent nature of curves) this results in uneven (non-linear) distribution of the dynamic range at either side of the point.

In this particular example, if I compare the two histograms the "after" histogram of the 0-200 is not simply a uniformly stretched out version of the "before" histogram of the 0-150. Instead, one side is stretched out more than the other.

To overcome this, I’ve created "linear curves" (my name) where instead of a single curve, I have two straight lines, one going from 0 to 200, and the other from 200 to 255. (I use a little VB program I wrote to generate AMP files.)

As I write over in "alt.graphics.photoshop" I’m now trying to figure out the ramifications of this. I suspect that, in the end, I want a smooth transition which curves create and just have to accept the non-linear nature of the rest of the histogram.

Is there something else you want to achieve then ?

The thing that prompted me was to be able to increase image contrast without clipping.

In the above example, let’s say that 0-150 contains a nice histogram "mountain" while the range 150-255 is a flat line. That "flat line" are the highlights which conventionally would be clipped because they are a relatively small portion of the overall image.

For example, employing the usual 0.3% to 0.5% clipping, anything over about 200 would be clipped (or re-scanned with boosted analog gain).

By using dynamic range compression/expansion I can expand 0-150 into 0-200 and compress 150-255 into 200-255, resulting in a image where no clipping has taken place. True, the contrast of the highlights is decreased somewhat but all the gradation is still there. However, the contrast of the 0-150 (now 0-200) has been increased considerably.

Don.
R
Roberto
Jul 8, 2004
Sorry if this is off-topic, but:

I don’t quite understand the technical side of this, but I have seen articles (namely the ones by Timo Autiokari) suggesting the use of gamma-space 1.0
in order to achieve linearity. All I could tell is that Curves work *differently* with my monitor calibrated to this gamma.

But, as I said, I’m not technically inclined…

Is there any reason whatsoever to work at gamma 1.0, and will that correct some issues that arise as a result of non-linearity of gamma 2.2 (or whatever)?

"Don" wrote in message
On Mon, 5 Jul 2004 19:57:12 +0200, "Pjotr Wedersteers" wrote:

"Don" wrote in message
I’d like to arbitrarily compress/expand different areas of dynamic range. Best explained with the histogram.

Let’s say I’d like to expand the range 0-150 to span 0-200, and conversely, compress the dynamic range 150-255 into 200-255.

If I see this correctly, curves is exactly the tool for this. If you put a marker at 150 and lift that to 200 (check input & output numbers) you will have expanded the 0-150 region to 0-200 at the cost of the
150 – 255 region, which now resides in the 200-255 region. I tried it and the resulting curve is not too extreme. Of course it all depends a lot on the picture whether the result is nice…

That’s what I have been doing, but I observed that (due to inherent nature of curves) this results in uneven (non-linear) distribution of the dynamic range at either side of the point.

In this particular example, if I compare the two histograms the "after" histogram of the 0-200 is not simply a uniformly stretched out version of the "before" histogram of the 0-150. Instead, one side is stretched out more than the other.

To overcome this, I’ve created "linear curves" (my name) where instead of a single curve, I have two straight lines, one going from 0 to 200, and the other from 200 to 255. (I use a little VB program I wrote to generate AMP files.)

As I write over in "alt.graphics.photoshop" I’m now trying to figure out the ramifications of this. I suspect that, in the end, I want a smooth transition which curves create and just have to accept the non-linear nature of the rest of the histogram.

Is there something else you want to achieve then ?

The thing that prompted me was to be able to increase image contrast without clipping.

In the above example, let’s say that 0-150 contains a nice histogram "mountain" while the range 150-255 is a flat line. That "flat line" are the highlights which conventionally would be clipped because they are a relatively small portion of the overall image.

For example, employing the usual 0.3% to 0.5% clipping, anything over about 200 would be clipped (or re-scanned with boosted analog gain).
By using dynamic range compression/expansion I can expand 0-150 into 0-200 and compress 150-255 into 200-255, resulting in a image where no clipping has taken place. True, the contrast of the highlights is decreased somewhat but all the gradation is still there. However, the contrast of the 0-150 (now 0-200) has been increased considerably.
Don.
H
Hecate
Jul 8, 2004
On Thu, 8 Jul 2004 02:52:03 +0200, "Branko Vukelic" wrote:

Sorry if this is off-topic, but:

I don’t quite understand the technical side of this, but I have seen articles (namely the ones by Timo Autiokari) suggesting the use of gamma-space 1.0
in order to achieve linearity. All I could tell is that Curves work *differently* with my monitor calibrated to this gamma.

But, as I said, I’m not technically inclined…

Is there any reason whatsoever to work at gamma 1.0, and will that correct some issues that arise as a result of non-linearity of gamma 2.2 (or whatever)?
No. But you can use different gammas in false profiling. You really need to get, if you can, a copy of Dan Margulis book, Professional Photoshop.

And be very, very careful about taking anything Timo says seriously. He has a very peculiar, and singular, view of the way things should be done.



Hecate

veni, vidi, reliqui
R
Roberto
Jul 8, 2004
Can you explain "false profiling", please? I know it *sounds* bad, but that’s about all I could understand. 😉

"Hecate" wrote in message
On Thu, 8 Jul 2004 02:52:03 +0200, "Branko Vukelic" wrote:

Sorry if this is off-topic, but:

I don’t quite understand the technical side of this, but I have seen articles (namely the ones by Timo Autiokari) suggesting the use of gamma-space 1.0
in order to achieve linearity. All I could tell is that Curves work *differently* with my monitor calibrated to this gamma.

But, as I said, I’m not technically inclined…

Is there any reason whatsoever to work at gamma 1.0, and will that correct some issues that arise as a result of non-linearity of gamma 2.2 (or whatever)?
No. But you can use different gammas in false profiling. You really need to get, if you can, a copy of Dan Margulis book, Professional Photoshop.

And be very, very careful about taking anything Timo says seriously. He has a very peculiar, and singular, view of the way things should be done.



Hecate

veni, vidi, reliqui
PE
phoney.email
Jul 8, 2004
It’s not really off topic because, in the end, it’s the non-linear gamma (in my case 2.2) which is causing this imbalance.

I did consider working in linear gamma of 1.0 and converting only at the very end, but the problem was my display. I’m doing all this on a notebook. So not only is it an LCD, but a notebook LCD… ‘Nuff said… 😉

It is my understanding that all graphics routines are inherently linear, and from that angle it would seem logical to work in Gamma
1.0. However, display devices are not linear so "convincing" them to
display at gamma 1.0 may be more trouble than it’s worth. Most pros seem to accept non-linear gamma. I, on the other hand, am just a simple civilian.

To paraphrase that commercial of a few years ago:

I’m not a pro but I play one on the Internet… ;o)

Don.

On Thu, 8 Jul 2004 02:52:03 +0200, "Branko Vukelic" wrote:

Sorry if this is off-topic, but:

I don’t quite understand the technical side of this, but I have seen articles (namely the ones by Timo Autiokari) suggesting the use of gamma-space 1.0
in order to achieve linearity. All I could tell is that Curves work *differently* with my monitor calibrated to this gamma.

But, as I said, I’m not technically inclined…

Is there any reason whatsoever to work at gamma 1.0, and will that correct some issues that arise as a result of non-linearity of gamma 2.2 (or whatever)?

"Don" wrote in message
On Mon, 5 Jul 2004 19:57:12 +0200, "Pjotr Wedersteers" wrote:

"Don" wrote in message
I’d like to arbitrarily compress/expand different areas of dynamic range. Best explained with the histogram.

Let’s say I’d like to expand the range 0-150 to span 0-200, and conversely, compress the dynamic range 150-255 into 200-255.

If I see this correctly, curves is exactly the tool for this. If you put a marker at 150 and lift that to 200 (check input & output numbers) you will have expanded the 0-150 region to 0-200 at the cost of the
150 – 255 region, which now resides in the 200-255 region. I tried it and the resulting curve is not too extreme. Of course it all depends a lot on the picture whether the result is nice…

That’s what I have been doing, but I observed that (due to inherent nature of curves) this results in uneven (non-linear) distribution of the dynamic range at either side of the point.

In this particular example, if I compare the two histograms the "after" histogram of the 0-200 is not simply a uniformly stretched out version of the "before" histogram of the 0-150. Instead, one side is stretched out more than the other.

To overcome this, I’ve created "linear curves" (my name) where instead of a single curve, I have two straight lines, one going from 0 to 200, and the other from 200 to 255. (I use a little VB program I wrote to generate AMP files.)

As I write over in "alt.graphics.photoshop" I’m now trying to figure out the ramifications of this. I suspect that, in the end, I want a smooth transition which curves create and just have to accept the non-linear nature of the rest of the histogram.

Is there something else you want to achieve then ?

The thing that prompted me was to be able to increase image contrast without clipping.

In the above example, let’s say that 0-150 contains a nice histogram "mountain" while the range 150-255 is a flat line. That "flat line" are the highlights which conventionally would be clipped because they are a relatively small portion of the overall image.

For example, employing the usual 0.3% to 0.5% clipping, anything over about 200 would be clipped (or re-scanned with boosted analog gain).
By using dynamic range compression/expansion I can expand 0-150 into 0-200 and compress 150-255 into 200-255, resulting in a image where no clipping has taken place. True, the contrast of the highlights is decreased somewhat but all the gradation is still there. However, the contrast of the 0-150 (now 0-200) has been increased considerably.
Don.

TN
Tom Nelson
Jul 8, 2004
The graphics industry uses non-linear gamma, not Timo’s 1.0 gamma technique. Although Timo defends his theory vehemently, it’s not the way the professional world works.

Although gamma 1.0 generates occasional flame wars here, I suggest monitor calibration is a better way to accurate color.

Tom Nelson
Tom Nelson Photography

In article <cci5rs$b8$>, Branko Vukelic
wrote:

Is there any reason whatsoever to work at gamma 1.0, and will that correct some issues that arise as a result of non-linearity of gamma 2.2 (or whatever)?
R
Roberto
Jul 8, 2004
Monitor calibration is the only way if you ask any professional. The issue is not whether or not to calibrate but whether to calibrate for linearity or gamma space.

IMO, it all boils down to technical finesse and personal preference. Either way, it is possible to do a decent job.

Having said that, Timo’s definitely got me convinced. I’ve done some testing and since I’m able to produce good output using linearity space, I guess I’ll stick to it until it lets me down.

"Tom Nelson" wrote in message
The graphics industry uses non-linear gamma, not Timo’s 1.0 gamma technique. Although Timo defends his theory vehemently, it’s not the way the professional world works.

Although gamma 1.0 generates occasional flame wars here, I suggest monitor calibration is a better way to accurate color.

Tom Nelson
Tom Nelson Photography

In article <cci5rs$b8$>, Branko Vukelic
wrote:

Is there any reason whatsoever to work at gamma 1.0, and will that correct
some issues that arise as a result of non-linearity of gamma 2.2 (or whatever)?
H
Hecate
Jul 9, 2004
On Thu, 8 Jul 2004 08:10:17 +0200, "Branko Vukelic" wrote:

Can you explain "false profiling", please? I know it *sounds* bad, but that’s about all I could understand. 😉
Sure. You profile your monitor as normal, say Gamma 2.2 for PC and set your working colour space, say Adobe RGB.

Now, suppose you have an image that is in CMYK, and the image is flat and too dark. You want to increase the gamut and at the same time lighten the image. It may be that you only want a specific colour range increased, say the Magenta/Yellow (i.e. reds in RGB).

You set up a profile with Wide Gamut RGB at 1.0. Save your CMYK as Adobe RGB. You then do image/mode/convert to profile and convert to the rather bright new profile you’ve just designed (put your sunglasses on first).

Then, you take a look at the red channel in the Wide gamut RGB and find that it’s a lot nicer than the one that you have in the Adobe (converted from CMYK) image. SO you take the red out of this false profile (false because in real life you’d *never* use such a profile) and blend it into the red channel of your AdobeRGB file. Hey presto, whizzy new reds. 😉

Of course, it’s more complex than that and can involve you swapping through different profiles and correcting in any of the three normal colour spaces (CMYK, RGB, LAB). But, essentially, that’s the idea.



Hecate

veni, vidi, reliqui
R
Roberto
Jul 9, 2004
Thanks for the explanation, but I’m not quite sure I uderstand you, yet.

If I calibrate the monitor correctly and if I don’t try to pull off some stunts with color profiles, everything should be okay, right?

The way I work is pretty straightforward: I calibrate, set up my working profiles and proceed to editing, convert either or both when I open the image and when saving it. That’s about all the fiddling I do with profiles. I try to stay within output space’s gamut and try not to go beyond. Since I work exclusively with books, that’s not so hard to achieve. Also, I tend to send my files to printing houses in RGB and let them deal with conversions (which has been working fine with most houses so far). If they do screw up (or if I think they will), I send them the image converted to an ISO CMYK profile that works nice on most of commercial offset printers (although it doesn’t get the most out of the printers). BTW, people here don’t bother creating profiles (it’s hasn’t yet become a standard way of CMing). The either do nothing or rely on old visual calibration methods (the latter seems to work as well as modern methods but does not provide you with ICC profiles).
H
Hecate
Jul 10, 2004
On Fri, 9 Jul 2004 12:58:33 +0200, "Branko Vukelic" wrote:

Thanks for the explanation, but I’m not quite sure I uderstand you, yet.
If I calibrate the monitor correctly and if I don’t try to pull off some stunts with color profiles, everything should be okay, right?
The way I work is pretty straightforward: I calibrate, set up my working profiles and proceed to editing, convert either or both when I open the image and when saving it. That’s about all the fiddling I do with profiles. I try to stay within output space’s gamut and try not to go beyond. Since I work exclusively with books, that’s not so hard to achieve. Also, I tend to send my files to printing houses in RGB and let them deal with conversions (which has been working fine with most houses so far). If they do screw up (or if I think they will), I send them the image converted to an ISO CMYK profile that works nice on most of commercial offset printers (although it doesn’t get the most out of the printers). BTW, people here don’t bother creating profiles (it’s hasn’t yet become a standard way of CMing). The either do nothing or rely on old visual calibration methods (the latter seems to work as well as modern methods but does not provide you with ICC profiles).
I had to give you the (very) condensed version. I first found out about this from reading Dan Margulis’ Professional Photoshop. Basically, with the t4echniquers in that book I doubt that there is an image you couldn’t improve, or an image that’s too bad to make acceptable.

Thing is, if you read that book he goes on about the colour space effectively being CMYKRGBLAB. In other words you should be able to convert between those spaces and use whatever is best to correct an image. And, so I’ve discovered, he’s right. it doesn’t mean I agree with everything he says, but his ideas have certainly improved my end product. And now, I always look at image and think, "How can I improve it?"



Hecate

veni, vidi, reliqui
R
Roberto
Jul 10, 2004
Yes, that sounds quite agreeable. If I get a chance, I’ll try to find that book.

"Hecate" wrote in message

[sic]

I had to give you the (very) condensed version. I first found out about this from reading Dan Margulis’ Professional Photoshop. Basically, with the t4echniquers in that book I doubt that there is an image you couldn’t improve, or an image that’s too bad to make acceptable.

Thing is, if you read that book he goes on about the colour space effectively being CMYKRGBLAB. In other words you should be able to convert between those spaces and use whatever is best to correct an image. And, so I’ve discovered, he’s right. it doesn’t mean I agree with everything he says, but his ideas have certainly improved my end product. And now, I always look at image and think, "How can I improve it?"



Hecate

veni, vidi, reliqui
H
Hecate
Jul 11, 2004
On Sat, 10 Jul 2004 11:42:30 +0200, "Branko Vukelic" wrote:

Yes, that sounds quite agreeable. If I get a chance, I’ll try to find that book.
The latest one includes PS 7, but a lot of what suggests can easily be found in a PS 6 version, so you may be able to get an older copy cheaply.



Hecate

veni, vidi, reliqui

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