Settings for use in the photo processing scripts
These are the settings/options that I have used. You might like then, want to change them or want to experiment & extend them. That's all good!
We'll work through the settings/folders & how you might make changes. The settings files themselves are simple text files, make them with any text editor that you like, including using nano from within Termux if you really feel like it.
White Balance
what reference to use to set white balance.
Once you've got a reference photo you need to extract the parameters that dcraw uses in place of the standard reference white balance. (By default, dcraw uses a fixed white balance based on a color chart illuminated with a standard D65 lamp.)
If you feed your reference photo into dcraw then you can use "dcraw -a -v" to calculate the white balance by averaging the entire image. The output will give you the multipliers as part of the printout.
-r m1 m2 m3 m4
It sets a custom user white balance. These 4 values are the multipliers that will scale linearly all levels found in the RGBG channels in that order. The white balance means a scaling of image levels therefore all levels will move from their original positions which could not be desirable in certain cases. If we are not to perform any white balance we will use the option-r 1 1 1 1.
As mentioned earlier I've found that there are a set of plausible white balance multipliers for my infrared photos. These might work as a starting point. Put them into individual text files (one for each line). Name the files with something that you'll be able to use to prompt you later when you have to pick the right one.1.160998 1.000000 2.820937 1.000000
1.885820 1.000000 1.744463 1.000000
0.507 1.000 2.4492 1.0000
Hue/saturation adjustments
Like the next setting you'll need to include the option, as well as the parameters. You've seen the setting for the aerochrome version already-modulate 100,150,-60
Here's another version that works better for black & white photos-contrast-stretch 2%x1% -modulate 100,0
As you can see you don't have to restrict yourself to a single type of option for ImageMagick in the settings (or even a single option, just write them out as if they were on the command line, the same as in the second example).
We created another folder for use with photos that aren't taken using the IR filter. The same principles & settings + parameters go into that folder. They are kept separate so that you can have 2 sets of adjustments, one for IR & one for normal photos. Otherwise they are the same settings!
Channel swaps
These settings go into the next folder (keeps it easier to tell which settings you are choosing!). Here are some potential settings to test out.
-color-matrix 0,0.25,1,0,1,0,0.96,0.25,0.04
-color-matrix 0,0,1,0,1,0,1,1,-1
-color-matrix 0,0,1,0,1,0,1,0,0
Lens adjustments (-distort)
Rather than changing the colours of the photo it might be useful to distort the photo, to compensate for barrel distortion from that fish eye lens, or to turn a photo into one of those "tiny planet" pictures where the image is wrapped into a circle.
The processing script parameters include the "-distort" part of the command (we can assume it), so all that's needed are the parameters to pass to the script in order to stretch the image into the projection that we want.
Fish eye (barrel) correction. Well, a starting point for it.barrel 0.194726 0.0479327 -0.710614
Or you could try something closer to thisbarrel -0.0356182 0.0565048 0.411286
barrel 0.06335 -0.18432 -0.13009
Maybe a "tiny planet" would be a better optionarc 360
Colour Look Up Table
This is where I came in. You can read a bit more about hald-CLUT here. You need a CLUT image, then it needs to be selected & the location passed to the script so that the colours in the processed image can be mapped to the ones in the CLUT file. There are no parameters to passs, so all that you need to do is to download the CLUT files to the folder that you made earlier & then select the one that you want as part of the command line/script. We'll get to the script in a little while...
Here's a quick conversion process if you don't fancy the other options:
In termux pkg in gmic
nano cube_to_lut.sh
Then paste this
#!/bin/bash
# run this script in the directory containing your luts
for file in *
do
gmic -input_cube "$file" -r 64,64,64,3,3 -r 512,512,1,3,-1 -o "$file".png
done
chmod +x ./cube_to_lut.sh
You'll then have to put the .cube files where you can run the script (or rewrite the script to replace the * with the location of your cube files).
Run the script & then move the png files to your $CLUTdir so that you can use them. There will be a bit of housekeeping involved as you'll have some files that you don't want/can't use.