I have in fact looked at your demosaicing page! I came up with my own way to do it, simplified even.
Using
http://img.photographyblog.com/reviews/ ... _hs_08.cr2
1. Extract mosaic (let dcraw apply camera white balance, autoleveling, and gamma correction)
Code: Select all
dcraw64.exe -6 -d -w -T canon_powershot_sx50_hs_08.cr2
2. Demoasic via 'superpixels'
Code: Select all
magick canon_powershot_sx50_hs_08.tiff ^
( -clone 0 -define sample:offset=25,75 -sample 50%x50% ) ^
( -clone 0 -define sample:offset=25,25 -sample 50%x50% ) ^
( -clone 0 -define sample:offset=75,75 -sample 50%x50% ) ^
( -clone 2-3 -evaluate-sequence mean ) ^
-delete 2-3 ^
( -clone 0 -define sample:offset=75,25 -sample 50%x50% ) ^
-delete 0 ^
-combine ^
-modulate 100,180,100 ^
binned.jpg
I'm using a different set of clone operations than you do, and skip the need to use batch files by letting dcraw do some work.
What I *actually* want to do is use -sample instead of -evaluate-sequence mean, so that I can bin 4x4 superpixels.
It would work like this:
-As per the previous message, let each Bayer colour shine through, with the rest black. This creates 3 images.
-Multiply the greyscale image which mask the green pixels by 2. Multiply the others by 4. This is a trick to account for the black pixels which are about to get averaged in; I pre-multiply to counter-act.
-Sample to 50%
-combine
Now I can do it again but for 25% size, and multipliers of 8/16.