Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.67k stars 306 forks source link

Feature request: allow debayering of non-RAW monochrome files #2887

Closed simontheflutist closed 8 years ago

simontheflutist commented 8 years ago

I would like to be able to convert a number of RAW files using the "mono" Bayer processing, combine them by mean or median stacking (or do something similar to HDRmerge), and then reprocess the resulting TIFF as though it were RAW.

Basically, allow import of a grayscale non-RAW image as though it were RAW.

Beep6581 commented 8 years ago

Sounds like something best done by yourself using a script and imagemagick/graphicsmagick: http://rawtherapee.com/forum/viewtopic.php?p=42891#p42891

simontheflutist commented 8 years ago

I had a look at the Imagemagick script. The script does the mono conversion using dcraw and the blending using Imagemagick, but you'll find that the output is really a TIFF image renamed to DNG.

Try it yourself. It's not a true DNG. It works as a dark frame because RawTherapee reads it as a TIFF, and RawTherapee will accept any raster image file as a dark frame definition. RawTherapee's file browser would fail to display this pseudo-DNG because it really isn't a DNG.

My desired behavior is as follows:

  1. Export NEF as a "mono" 16-bit TIFF.
  2. Open TIFF in RawTherapee and turn on amaze demosaicing as if it were a DNG. (Is RAW metadata preserved? If not, prompt user for a template RAW.)
Beep6581 commented 8 years ago

DNG is TIFF/EP, with the appropriate contents described using appropriate metadata.

Apply the Neutral profile to some raws. To save them in a linear way, open each and click "Save reference image for profiling" from the Color Management tool. If you save them the usual way you will need to undo the gamma curve either in imagemagick or perhaps via an input profile. Then:

convert *.tif -evaluate-sequence mean out_mean.tif
exiftool -DNGVersion=1.4.0.0 -IFD0:CFAPattern2='0 1 1 2' out_mean.tif
mv out_mean.{tif,dng}

0 1 1 2 is the bayer pattern for my Pentax K10D, [Red,Green][Green,Blue] To find out your camera's pattern, convert one of your raw shots to DNG using Adobe DNG Converter and

exiftool "-cfapattern*" -G1 yourshot.dng

For other averaging methods,

convert -list evaluate

Only mean and median make sense.

http://i.imgur.com/i935EAH.png http://i.imgur.com/ZgV0kvt.jpg http://i.imgur.com/hJab2MW.jpg http://i.imgur.com/nMspTie.jpg

See? Works.

If you want mean/median stacking of raw files, ask for it over at https://github.com/jcelaya/hdrmerge , a program which already handles the white/black point, gamma, color, etc issues you will run into. Closing this issue.

plasticalligator commented 1 year ago

Hilarious how useful this would be in contrast to the author being oblivious to what was even asked.

10/10