View Full Version : What is the Linear in conversion?
martcol
11th of May 2003 (Sun), 14:02
So, all you techies. Can anyone tell me in words of two Syllabubs or less, what the linear bit is in linear conversion. I notice that it also pops up in Photoshop as well in things like layer blending modes, or somewhere.
I want to know because I am trying to get to grips with RAW and RAW conversion. It's an option in BB and although the default settings seem OK, it would be good to know what is going on and if I can do better.
Martin
Roger_Cavanagh
11th of May 2003 (Sun), 17:07
Would that be a lemon syllabub or a raspberry syllabub? :)
The way I understand it: the linear image represents the light as captured by the sensor. There is a linear relationship between the recording and the amount of light falling on the sensor pixels. This is different from the way we see the world, which is why the linear image looks dark. An adjustment curve must be applied to the image so that it looks "normal".
I guess the PS linear mode bears some relations to this concept, but I don't know exactly what.
Regards,
robertwgross
11th of May 2003 (Sun), 19:13
Linear is like a set of stairs on a well-designed stairway. Each step up is exactly the same height as the one above it and the one below it.
A non-linear series would look like a set of stairs where there are very short ones at the bottom and very tall ones at the top.
When you convert from analog, real-world readings (like light intensity on a sensor), you often go through a non-linear encoding scheme, and this can relate to gamma.
---Bob Gross---
martcol
12th of May 2003 (Mon), 00:22
Roger, I hope it's Raspberry & not a Lemon! ;)
That makes sense about a "linear relationship" like input output values in Curves or Levels (histogram)?
Bob, "...go through a non-linear encoding scheme, and this can relate to gamma
Not sure what you mean there.
Thanks both of you. So, what does it all mean to me in BreezeBrowzer?
Martin
Roger_Cavanagh
12th of May 2003 (Mon), 04:16
Martin,
Adjusting gamma changes the midpoint "brightness". Linear files have a gamma of 1, so they look very dark. Non-linear files have gamma around 2. A gray card is is a "mid-tone", but it's only 18% reflectance.
You can see how this works in PS using Levels and moving the midpoint (gamma) slider.
In BB, to get a linear file, all you have to do is choose linear rather than normal or combined conversion. This will give you the dark linear file, which must then be further adjusted. This is what LinearSharpen does for the D30 and D60.
I just read on Fred Miranda's forum that his LP Batch for the 10D (and 1Ds) is not far away.
Regards,
mwinog2777
12th of May 2003 (Mon), 22:26
It must be pointed out that linear conversion does not work well with 10D RAW; images come out posterized. So, for the 10D owners, the question is moot. With BB I use regular conversion, and am very happy with my results.
Roger_Cavanagh
13th of May 2003 (Tue), 04:57
mwinog2777 wrote:
It must be pointed out that linear conversion does not work well with 10D RAW; images come out posterized. So, for the 10D owners, the question is moot. With BB I use regular conversion, and am very happy with my results.
Hopefully, the mootness will disappear once the SDK bug that causes the problem is fixed. But in any case, Fred M is claiming good results with his yet-to-be-released 10D LPBatch even with the current problem.
We shall see...
kellylipp
13th of May 2003 (Tue), 07:39
Duh, that explains my lack of luck with Pekka's LS.
Now on the same lines, why one over the other? Why linear as opposed to normal? I would guess that linear conversion provides more data at the expense of extra processing?
Thanks,
Kelly
Leighow
13th of May 2003 (Tue), 10:32
This seems to me to be a very, very important subject.
********************************************
I have just started using the Canon Raw converter with my G2. Part of any answer ought to allow for an examination of an image file processed via both a linear and a non-linear process. So I did just that.
As far as I can tell, if you are a purist the two approaches lead to quite different results and they also impact subsequent processin.
NON-LINEAR
**********
I did nothing to this image but convert from RAW. This brighter picture is far sharper. And as you alter same in PS the preview follows instantaneously.
http://members.rogers.com/hleigh/NONLINEAR.jpg
LINEAR
******
If you just try curves or some combination of brightness and contrast, the image is not nearly as sharp-- even after an UMS (39/4/0). Also, while setting brightness( + 80)/contrast (+20) for the comparison, the PS Preview does not seem to function and so you have more difficulity fine tuning any settings. However I did nto take the time to perfectly match the two images. What I can say is that this linear image gave me the impression that it caried a nicer amount of detail in the clouds -- albethis at the price of considerable sharpness.
http://members.rogers.com/hleigh/LINEAR.jpg
Frankly I am not sure what I will do next. But it sounds like I should but Breezebrowser.
HOWIE
martcol
13th of May 2003 (Tue), 11:08
Howie
That's really interesting I'm on the edge of my seat wonderin' what others think.
Martin
daveh
13th of May 2003 (Tue), 11:19
Yes that's what linear conversions are good for. (Highlights with sky being the number one highlight problem.)
I wouldn't expect a true sharpness difference and I didn't see one in a glance at the pictures shown but gamma correction is going to provide more low/mid contrast/punch at the expense of highlights which may be perceived as sharpness.
Roger_Cavanagh
13th of May 2003 (Tue), 11:39
kellylipp wrote:
I would guess that linear conversion provides more data at the expense of extra processing?
Yes, although it is possible use a linear profile that gamma corrects and colour adjusts in one step.
Regards,
Roger_Cavanagh
13th of May 2003 (Tue), 12:14
Howie,
The difference between your two images is partly down to contrast, I would say. Aslo there are some suspicious haloes along some of the branches in the non-linear version, which make me suspicious.
Brightness/contrast controls are two clumsy. You should use levels and curves.
I seem to remember Timo posting a manual correction for linear images. I'm too lazy to look right now, but it goes something like:
Run Levels: check in colour channel and find the highest individual value in the three channels. Adjust the white point slide to this value. An easy way to do this is to use Options>Enhance mono contrast with no clipping.
Adjust the gamma slider to say 2.2.
Use Curves to increase overall brightness further.
This does a decent job of giving a usable image, but some colours may not be perfect.
Regards,
Roger
Leighow
13th of May 2003 (Tue), 20:23
ROGER
Thanks for the tips. I must admit that I am a beginner in PS and must try all of the above for the 1st time.
HALO
****
I did not revisit this, but I do seem to recall that the halo disappeared when I cranked up the image size, so at the time I "thought" that it might have something to do with PS scaling. I was surprised that it got carried along in the Convert for the Web.
LINEAR
******
But back to the clouds and LINEAR. I must say that the clouds in the "blue right hand side" seemed nicer to me... but... on the other hand and again limited perhaps by my PS skills the clouds washed out quicker too when I just used brightness.
NON-LINEAR
**********
I should also mention that this is was my favouritew shot in a time series of 20. I processed them all last week NON-LINEAR. I had not given LINEAR any consideration until Martin's post.
While the entire image washed out the sun as a circle, it delivered that splash of blue right-hand sky. I kept the RAW in order to exploit just this kind of knowledge fix.
http://photography-on-the.net/forum/showthread.php?t=10576#50099
HOWIE
Timo Autiokari
14th of May 2003 (Wed), 09:50
the linear image represents the light as captured by the sensor. There is a linear relationship between the recording and the amount of light falling on the sensor pixels.
Yes, that is correct.
This is different from the way we see the world,
No, the same linear light from the real-world scene that hits the sensor of the camera also hits the eyes.
which is why the linear image looks dark
No, the CRT monitors have a gamma 2.5 transfer function (down curve) so linear image data appears as very dark (without color-management).
An adjustment curve must be applied to the image so that it looks "normal".
Yes, linear data needs gamma 1/2.5 up-curve, that way the image luminance on the (non-color-managment) CRT again is about linear, like it was in the real world.
Liner conversion is the best choise because:
-it gives the RAW data that has not been mangled by the camera firmware. Least amout of errors and very good for ICC profiling.
-detail is not lost due to the gamma compression.
-high quality image manipulation is based on linear workflow so non-linear tweaking of the data only gives penalties.
Timo
martcol
14th of May 2003 (Wed), 13:35
Timo Autiokari wrote:
CRT monitors have a gamma 2.5 transfer function (down curve) so linear image data appears as very dark (without color-management).
Yes, linear data needs gamma 1/2.5 up-curve, that way the image luminance on the (non-color-managment) CRT again is about linear, like it was in the real world.
Very interesting Timo, thanks, but what do those bits mean? Can you break it down a little more?
Martin
soumya63
14th of May 2003 (Wed), 13:48
My 2c
Gamma is a physical characteristic of the monitor phosphors. For PC, the monitor phosphors have a gamma ranging from 2.0 to 2.8.
What it means that the energy of the electron from the picture tube hitting the phosphors are not translated linearly to the light emitted by them. So we need to compensate this non linear characteristics of phosphors by changing the source picture file. This is exactly what a raw to linear / non-linear converter like Breezebrowser does. First it converts a RAW to a tiff file by using Canon’s API, and then applies a gamma correction over it. Pekka’s action does not do the RAW to linear tiff conversion. What it does is applying a gamma correction on a Linear file and generating a non-linear tiff.
The gamma characteristics changes with the age of your monitor. Also it varies from PC to Mac. So a non-linear file for a PC will look washed away on a Mac screen and a Mac non-linear file will look too dark on a PC Screen.
This also opens the door of a vast and absorbing subject of Color management. Professional and semi professional Photogs like me use monitor profiling system. It is a software and a hardware (colorimeter) combo, which profiles the monitor and creates a ICC profile, so that the non-linear converted files looks right and matches the exact color of the profiled print.
Lastly, it is incorrect that a RAW file is sharper than a non-linear file. The conversion process should not alter the sharpness. All it does is apply a gamma correction so that the picture looks correct on your screen. You can do the same conversion by using Photoshop manually by tweaking the gamma curve of a linear tiff file.
www.mitraphoto.com
daveh
14th of May 2003 (Wed), 13:56
Let's try my ASCII art skills ;)
Output devices (CRTs) have a non-linear transfer function so you apply a reverse non-linear transfer function to make images look right.
Since your CRT has a transfer function like:
| *
| *
| *
| *
| *
| *
| **
| ***
|****
+------------------
(x is the input pixel value - y is the output pixel value.)
You counteract it by applying something like:
| ****
| ***
| ***
| **
| *
| *
| *
|*
|*
+------------------
The end result LOOKs linear.
Since most of your data is in the middle, this brightens the overall appearance, and adds contrast at the dark to mid end, but notice what's happening to your bright pixels. The high range is being squished into a much smaller space losing detail.
Timo Autiokari
15th of May 2003 (Thu), 12:04
Martin,
ok, so we need some parallel analogy, another imaging path than the scene-camera-computer-CRT. A common mirror is such an imaging path, the mirror does sense the scene luminances (and colors) and it then shows them for our eyes. While doing this the mirror scales the luminance range down a little since it does not have reflectance of 100%, this scaling is linear so that if the reflectance of the mirror is 90% then the scene values are all multiplied by 0.9. So, the the tonal reproduction function (or transfer function) of a mirror is linear (not curved) it just scales down linearly (the relative ratios are preserved). And worth to note at this point... what we see from the mirror appears for us as an accurately matching image of the real-world scene, we could say that the color-management system that is built into a common mirror is perfect.
Now then, when we want to show an accurately matching image of the real word scene on the CRT it has to ouput the scene luminances similarly like the mirror does, so the tonal reproduction function must be linear. It also must scale down since the max luminance of the CRTs is very low, around 100cd/m2 only. Due to the rather low maximum luminance level of the CRT there are some imaging situations (very bright scenes where the max luminance is thousands of cd/m2) where we do need to apply some perceptual enhancement over the linear data, e.g. a slight up-curve, due to the low maximum luminance level of the CRT, but in general we need the linear tonal reproduction function, for most imaging situations it is perfect.
So then, in our digital imaging path the CCD sensor behaves like the mirror, it is a linear sensor (CMOS sensors are not linear, but e.g. Canon cameras provide the linear RAW mode by software). The A/D converter behind the sensor also behaves linearly but on the ouput side the CRT is not linear, all CRTs have (rather accurately) tone reproduction curve of gamma 2.5, this is the function how the voltage that is applied to the electron grid in a vacum tube affects to the cathode current (phosphors behave absolutely linearly, they convert accelerated electrons that hit them to visible light by a constant efficiency). The gamma function is: ouput=input^gamma where input and output ranges are from 0 to 1 (normalized). The "^" mark is the power operator.
Because of the CRT gamma linear image data appears extremely dark (without color-management). If you e.g. view linear image data using Photoshop in a linear RGB working-space then the tonal range appears correctly.
Most of the CRTs over the Internet are not calibrated nor using color-managment so in order to show images properly there the image data has to be compensated so that after the CRT tube applies the gamma function the luminances that the CRT shows will have linear relation to the scene luminances. So when publishing to the internet the image data is compensated by the inverse gamma function: ouput=input^(1/2.5) since ouput=input^(1/2.5)^2.5 results: output=input.
Nowadays the above is easily done using the ICC color-management and not only the tonality but also colors are converted correctly, e.g. my workflow from my D60 to the Web is as follows:
1. Acquire linear RAW, 16-bit/c mode.
2. Asssign the D60 device profile.
3. Convert to a linear RGB working-space (AIMRGBpro).
4. Do all editing there, then save as The Final Original in PSD format.
5. Convert to nativePC profile.
6. Drop down to 8-bit/c and save as JPG.
The importance of the linear RGB working-space comes from the fact that the light is/behaves linearly, but it calls for a very long lecture in order explain why actually it is so, I demonstrate these errors at my Gamma Induced Gallery on my site using many on-top-of-each-other comparision examples. Shortly, nearly all image editing operations create errors when they are applied over non-linear image data, one very familiar example of such error is the white halo from sharpening or USM. An other major problem is that accurate gray-balancing is practically impossible in non-linear working spaces where in linear working-spaces it is a very simple task, just linear scaling of two color channels using the levels dialog. Etc etc, there are only a very few editing operations that do not suffer from Gamma Induced Errors when working in non-linear working-spaces (such as the AdobeRGB and the sadRGB are).
Timo
gmitchel
8th of June 2003 (Sun), 15:09
Roger_Cavanagh wrote:
[quote]mwinog2777 wrote:
Fred M is claiming good results with his yet-to-be-released 10D LPBatch even with the current problem.
We shall see...
Please reconsider purchasing actions from FredMiranda.com.
As artists, we should be very concerned about censorship.
You may not be aware of this point, but purchases of actions from FredMiranda.com encourages censorship.
FredMiranda.com is a heavily censored site. Even trying to discuss the issue of censorship in the appropriate forum results in threads that are locked and deleted.
Please, avoid FredMiranda.com and buy actions from sites that are tolerant and encourage free expression -- sites like DPR and Canon Digital Photography Forum!
Cheers,
Mitch
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.