setting crs:Exposure value from -ExposureCompensation

Started by LKB, August 11, 2012, 03:12:23 PM

Previous topic - Next topic

LKB

Hello again,

During my normal shooting routine I tend to overexpose my pictures to improve SNR l and then push it back during post-processing. In shutter speed priority AE I could use -ExposureCompensation value to set  -crs:Exposure for my post-processing in Camera Raw. Unfortunately it does not seems to work

exiftool.exe -tagsfromfile %%d%%f.ARW "-ExposureCompensation" -crs:Exposure= -overwrite_original  -r -ext XMP .
exiftool.exe -tagsfromfile %%d%%f.XMP "-ExposureCompensation>crs:Exposure" -f -r -ext XMP .

gives me @Tag 'crs:Exposure' does not exist. It does so even with the files who has been allready processed by CR so do have a tag. Am I missing something here?

On similar note I have no idea what to do with manual exposure, is there any value recording how much image has been overexposed from the value estimated by the camera using its metering ?

LKB

I played with the code a bit, but still to no awail. Sidecar XMP file with lens information is created for each ARW before this batch is executed.

exiftool.exe -tagsfromfile %%d%%f.ARW "-ExposureCompensation" -overwrite_original  -r -ext XMP .
exiftool.exe -tagsfromfile %%d%%f.XMP "-ExposureCompensation>crs:Exposure" -f -r -ext XMP .

Phil Harvey

#2
I'm not sure if CameraRaw will respond to the Exposure tag as you want, but you set it with "XMP-crs:Exposure" in ExifTool.

Some cameras record a MeasuredLV, but without knowing your camera model I can't answer the manual exposure question.

- Phil

Edit:  Oh, I see it's a Sony camera (ARW file).  Sony cameras store a BrightnessValue which may be compared with the calculated LightValue to determine the degree of over/underexposure.  I think that the LightValue should be equal to BrightnessValue + 5 for a properly exposed image.  (I'm not sure where the constant 5 difference comes from, but looking at some images this seems to be about right.)

Edit2: After a bit of research, it seems that the difference of 5 may be the Sv value for ISO 100, since LightValue is normalized to ISO 100.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB

Phil,
It does work. Thank you for your help. So code does work

exiftool.exe -tagsfromfile %%d%%f.ARW "-ExposureCompensation>XMP-crs:Exposure" -f -r -ext XMP .

but... I actualy need reverse of this value so XMP-crs:Exposure=-ExposureCompensation. I tried to play with code a bit but I cant get it to work as - indicated something already. Is it possible to do those aritmetic operations?

I also checked your ISO suggestion and I think you are very right. Only problem is that +5 seems to only refer to ISO 100 so with ISO 200 this will be more like +3.5, and this is what I am getting from my images ($LightValue-$BrightnessValue= 3.4 ). So so far so good. But again, only if I can get arithmetical calculus. Is it possible to do ? So combining both questions (and simplifying issue but ignoring ISO correction), this code

exiftool.exe -tagsfromfile %%d%%f.ARW "$LightValue-5-$BrightnessValue>crs:Exposure" -f -r -ext XMP .
give me "No writeble tag set" error. Is there anything I can do here?

edit: small edits to the code

Phil Harvey

To go the other way you do this: -xmp-crs:exposure<exposurecompensation

To derive a value from other tags you need to create a user-defined Composite tag.  See the config file documentation or search this forum for examples.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB

Phil,
Thank you for help so far and apologies for a bit delayed response due to conference.
Following equation ExpCorrCR =-(LightValue-BrightnessValue-(5-1.6*ISO/100))
which should give me corr at any ISO and bearing in mind that to correct image I need a negative (if I overexpose +1 I need to indicate -1 to CR and so on), I declare my  composite tag as:

Image::ExifTool::UserDefined => {
'Image::ExifTool::Composite' => {
ExpCorrCR => {
Require =>{
0 => "LightValue",
1 => "BrightnessValue",
2 => "ISO",
},
ValueConv => 'int(-($val[0]-$val[1]-(5-1.6*(val[2]/100))))',
},
};
and save as exif_CRcorr.lkb file

But now I got a bit of a problem. What I need is:
1) from each ARW to extract LightValue, BrightnessValue and ISO
2) calculateExpCorrCR
3) assign its value to XMP-crs:Exposure in corresponding XMP file, which might not have XMP-crs:Exposure field yet.

is this command any good?

exiftool.exe -config exif_CRcorr.lkb -execute "-ExpCorrCR<LightValue,BrightnessValue,ISO" -tagsfromfile %%d%%f.ARW "-ExpCorrCR>XMP-crs:Exposure" -f -r -ext XMP .

Phil Harvey

#6
The config file looks good, but your command has a few problems.  You have a couple of extraneous options:  This may be executed as a single command so -execute isn't neded, and the -f option wasn't doing anything.  I think the command should look more like this:

exiftool -config exif_CRcorr.lkb -tagsfromfile %%d%%f.ARW "-ExpCorrCR>XMP-crs:Exposure" -r -ext XMP .

(note for others: the "%" characters are doubled because this command runs from a .BAT file)

- Phil

Edit: Oops.  I just noticed a number of small syntax errors in your config file.  This should work better:

%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
ExpCorrCR => {
Require =>{
0 => "LightValue",
1 => "BrightnessValue",
2 => "ISO",
},
ValueConv => 'int(-($val[0]-$val[1]-(5-1.6*($val[2]/100))))',
},
},
);
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LKB

Phil,

Code works perfect but my math seems to be wrong. I will try to update when have more time.