How to process raw data from a scanner in RT?

Hello,

the raw data from my scanner are without gamma-correction andwithout an ICC-profile. I would like to process such images with RT to compare results with the dedicated scanner software. My simle question is, how to apply a gamma of 0.4545 (or gamma´= 2.2, depending on the definition of gamma) to these images? Searching through RawPedia I could not find a gamma-correction tool in RT. Obviously it must be there, but where? ICC-profiles have been created with Argyll and would be applied via the color management tab.

Thanks in advance for any help!

Hermann-Josef

ArgyllCMS should be able to include a gamma curve in the generated ICC:
http://www.argyllcms.com/doc/Scenarios.html#PS1
That is the recommended way.

You can also use a tone curve in the Exposure tool to make a curve equivalent to any gamma using my Bash script. I formatted it across multiple lines for readability ( :joy: ):

gamma="2.2"; { \
printf '%s\n' "Spline" "0 0"; \
while IFS= read -r in; do \
    out="$(bc -l <<< "e(l(0.${in}) * $gamma)")"; \
    printf "%.1f %.5f\n" "0.${in}" "$out"; \
done < <(for x in {1..9}; do echo $x; done;); \
printf '%s\n' "1 1"; \
} > /tmp/rt_g"${gamma}".rtc

Replace $gamma with 1/$gamma if you need the reverse.
Then “Load a curve from file” in RawTherapee, for example as “Tone curve 1” in the Exposure tool, “Custom” curve mode.

Great, thank you. I will give this a try.

I used CoCa to create my profiles with gamma set to 2.2. But this does not give the correct brightness when applied in RT. So I concluded that gamma correction was not applied.

Best wishes
Hermann-Josef

Using as the input image a linear scan (raw data) and setting gamma = 2.2 in CoCa gave the correct result in RT :slight_smile: . So there is no need for a custom curve in the exposure tool in RT.

Thus the context help in CoCa is misleading as it says “use gamma 1 for images with linear gamma”. However, the complete story seems to be more complicated. If I use this profile in SilverFast, the images get far too bright. Obviously there the gamma-correction is then applied twice.

The Argyll documentation states that " the scanner needs to be configured to a suitable state, and restored to that same state when used subsequently with the resulting profile." From that I would conclude that incorporating the gamma-correction into the ICC-profile is the correct usage. I will have to contact SilverFast and see what their concept is.

Hermann-Josef

@Morgan_Hardwood can RT handle a 64-bit RBGI DNG file? I can obtain these types of files from my scanner software, but nothing that I’ve seen is able to handle them.

Which scanner software is producing these data? For SilverFast and for VueScan the RGBI files are the raw data files from the scanner. SilverFast raw data are multipage files with the RGB on the first page, preview (if selected) on the second page and the IR-channel for removing defects on the third page. VueScans’s format is different in that each pixel has 4 channels: R, G, B, and IR.

I am not aware of any external software of being able to make use of the IR-channel. Although the RGB image can be opened and edited in external software.

Hermann-Josef

I doubt it @paperdigits. RawTherapee handles 32-bit floating point DNG raw files, but there is no handling for the IR channel. I’m also skeptical about that file really using 64-bits per pixel per channel…

@paperdigits and @Morgan_Hardwood
this is a mis-understanding. It is not 64 bits / channel but it is 16 bits / channel x 4 channels = 64 bits / pixel.

One can use imagemagick or imageJ with bioformats to extract the IR-channel, but then what do you do with it (except writing your own software to correct fopr the defects in the RGB-image)?

Hermann-Josef

Excuse my ignorance. What the hell is CoCa?

CoCa is a graphical user interface to Argyll, a profiler to create ICC-profiles from IT8-targets.

Hermann-Josef

@Morgan_Hardwood sorry it is 16 bits per channel x 4 channels. I’m using VueScan, and I haven’t seen any software besides VueScan that can process these files. I’m going to be scanning a bunch of film soon, and don’t want to waste the space on files that large if I can’t do anything with the.

@paperdigits As I have described above, SilverFast and VueScan use different file formats for their raw data. These are the only scanning softwares I am aware of producing raw data. So you are stuck with VueScan to reduce them, at least for the scratch removal part. You could just use the IR-channel to remove defects in VueScan and store the result as 3x16bit RGB-TIF, which can then be opened by other image processing software like RT, GIMP or PS.

Hermann-Josef

Yes, use your dedicated scanner’s software to make the most of the IR channel, and if you want to do further processing then save as a RGB 16-bit TIFF ( 16x3 = 48-bit TIFF) and run it through RT.