PDA

View Full Version here: : Applying channel multipliers


rcheshire
23-07-2017, 09:41 AM
I found this particularly helpful and thought to share it, based on a Cloudy Nights (https://www.cloudynights.com/topic/529426-dslr-processing-the-missing-matrix/) thread, which explains the process quite well.

Apply DSLR channel multipliers to an image. The jpg's illustrate the effect on a post processed image. A little overdone but you get the idea. Multipliers need tweaking.

EDIT: The Orion image was taken with a modded 450D. The Eta image with an unmodded Nikon D3300 - files offered for download by and IIS member some time ago. So, I guess, if you don't have a modded camera this process may be of benefit.

Viewed on my phone the saturation is ridiculously over done.

The script requires ImageMagick. Edit to suit filenames and plug in your camera's matrix from here (https://www.dxomark.com/Cameras/Canon/EOS-450D---Measurements), for example.

#! /bin/bash

# Apply DSLR channel multipliers, obtained from

# https://www.dxomark.com/Cameras/Canon/EOS-450D---Measurements

# ImageMagick -color-matrix

# To run script from command line in Windows OS replace \ with ^ AFAIK...

# Canon 450D
# R sRGB G sRGB B sRGB
# R raw 1.91 -1 0.09
# G raw -0.19 1.65 -0.46
# B raw 0.07 -0.7 1.64

# Color matrix as defined in ISO standard 17321

# Play around with multipliers for Ha modded cameras

convert in.jpg -depth 16 -color-matrix \
"1.81 -0.8 0.07 0.0, 0.0, 0.0 \
-0.16 1.51 -0.4 0.0, 0.0, 0.0 \
0.05 -0.5 1.5 0.0, 0.0, 0.0 \
0.0 0.0 0.0 0.0, 0.0, 0.0 \
0.0 0.0 0.0 0.0, 0.0, 0.0 \
0.0 0.0 0.0 0.0, 0.0, 0.0" -alpha off out.jpg

animate -delay 100 -loop 0 -resize 800x600 -page 800x600 in.jpg out.jpg

exit

Depending on the success of trials I may add the process as an option to Asterism.

rcheshire
25-07-2017, 07:42 PM
This gets closer to the concept with linear images (thanks Bo). Nothing precise at this stage.

Applied to the final stacked image and then stretched, colour gradients are problematic, if not unworkable. The process should probably be applied post deBayer prior to stacking.

This was all done on an Android tablet, with dcraw and imagemagick installed in Termux, then gradient removal in Ivo's Android StarTools.
#! /bin/bash
# Apply DSLR channel multipliers, obtained from
# https://www.dxomark.com/Cameras/Canon/EOS-450D---Measurements

# Windows OS replace \ with ^ AFAIK...
# Canon 450D
# R sRGB G sRGB B sRGB
# R raw 1.91 -1 0.09
# G raw -0.19 1.65 -0.46
# B raw 0.07 -0.7 1.64

#Color matrix as defined in ISO standard 17321

# Nikon D3300
# R sRGB G sRGB B sRGB
# R raw 1.85 -0.74 -0.1
# G raw -0.17 1.56 -0.39
# B raw 0.05 -0.47 1.42

percent=100

Rr=$(echo "scale=4; 1.91/100*$percent" | bc )
Rg=$(echo "scale=4; -1/100*$percent" | bc )
Rb=$(echo "scale=4; -0.09/100*$percent" | bc )
Gr=$(echo "scale=4; -0.19/100*$percent" | bc )
Gg=$(echo "scale=4; 1.65/100*$percent" | bc )
Gb=$(echo "scale=4; -0.46/100*$percent" | bc )
Br=$(echo "scale=4; 0.07/100*$percent" | bc )
Bg=$(echo "scale=4; -0.7/100*$percent" | bc )
Bb=$(echo "scale=4; 1.64/100*$percent" | bc )

echo $Rr $Rg $Rb
echo $Gr $Gg $Gb
echo $Br $Bg $Bb

#Play around with multipliers for Ha modded cameras

cd storage/downloads

convert in.tiff -color-matrix \
"$Rr $Rg $Rb \
$Gr $Gg $Gb \
$Br $Bg $Bb" -alpha off out.tiff

convert in.tiff in.jpg
convert out.tiff out.jpg

animate -delay 100 -loop 0 -resize 800x600 -page 800x600 in.jpg out.jpg

exit