August 12, 2016 at 9:51 pm #18656
I just returned from Mexico not long ago, where we were out in the clear mountain air up close to 8,000 ft high. The sky at night was crystal clear, and I saw the Milky Way like I’ve never seen it before! I was glad that I had brought my wireless remote and that I had access to a tripod!
Here’s what the camera could see in a single 13 second exposure at ISO 2500 and f/2.8 without any editing.
Not bad, but I’ve seen better… 🙂 I could push the exposure in Lightroom and make it “pop” a lot more, but at ISO 2500 you’re going to get a lot of noise if you start pushing the exposure very far.
Thankfully, I took a lot more than one photo of the same thing. I’m a firm believer in stacking low-light astro images for noise reduction and SNR (signal-to-noise-ratio) improvement. I found that I had taken 18 frames in a row that I could stack to improve the picture.
So I took my 18 RAW frames, and exported them from Lightroom as 16-bit TIFF files without any adjustments. Then I used a couple of different free, open source software packages to align and stack those ~100MB files into 1 16-bit TIFF file.
First was the
align_image_stackcommand from the Hugin package. It properly aligned all the stars, but that threw the foreground out of alignment, because the stars were moving slightly between frames. No problem, I’ll fix that after stacking!
So after all the files were aligned, I used G’MIC and the
-average_filescommand to average the 18 files together into 1 16-bit file.
Here’s what I get after stacking and aligning:
Not much difference, eh? 🙂
But look what happens when we take the original and the stacked file and push the exposure in Lightroom? Ah hah! Now we can see the difference!
(An 18 frame stack vs. a single frame. Both processed identically in Lightroom)
So I took my 16-bit stacked/aligned file back into Lightroom for post processing. Here’s a rough breakdown of the settings I used:
Then I exported another 16-bit TIFF and one original frame, and combined the foregrounds in GIMP 2.9.5 so that the blurred foreground from the stacked image doesn’t show.
Finally, I used
exiftoolto copy the EXIF data from one of the original files to the finished file.
And here it is:
Just for interest’s sake, here’s a post I made a long time ago about the Milky Way in Africa.September 1, 2016 at 7:31 pm #18856
For those who are interested, here is the batch script that I used for processing a folder full of RAW astro-photos.
"C:\Program Files\RawTherapee-4.2.539\rawtherapee.exe" -b16 -t -w -c EJM*.PEF "C:\Program Files (x86)\Hugin\bin\align_image_stack.exe" -m -v -a aligned_ EJM_*.tif "C:\Program Files\gmic-1.7.5_pre-win64\gmic.exe" -average_files aligned*.tif -o averaged.tif,ushort DEL EJM_*.tif DEL aligned_*.tif "C:\Program Files\exiftool-10.25\exiftool.exe" -TagsFromFile EJM_0076*.PEF averaged.tif "C:\Program Files\RawTherapee-4.2.539\rawtherapee.exe" -w averaged.tif PAUSE
If you have RawTherapee installed, just make sure that you have the correct path in the first line of code (replace the words between the quotes, leave the rest of the code intact). You’ll need Hugin for the
align_image_stackexecutable, and you’ll have to make sure that you have the correct path for it as well. GMIC you can get here. Install it, and point the script to your executable.
exiftoolis for copying the EXIF data from one of the original files to the stacked file. You can download EXIFTool here.
You’ll also need to change the filename prefixes in the code to your camera’s default. (Usually something like IMG_ or DSC_)
So the changed code (for the IMG_ prefix) would be:
"C:\Program Files\RawTherapee-4.2.539\rawtherapee.exe" -b16 -t -w -c IMG*.PEF "C:\Program Files (x86)\Hugin\bin\align_image_stack.exe" -m -v -a aligned_ IMG_*.tif "C:\Program Files\gmic-1.7.5_pre-win64\gmic.exe" -average_files aligned*.tif -o averaged.tif,ushort DEL IMG_*.tif DEL aligned_*.tif "C:\Program Files\exiftool-10.25\exiftool.exe" -TagsFromFile IMG_0076*.PEF averaged.tif "C:\Program Files\RawTherapee-4.2.539\rawtherapee.exe" -w averaged.tif PAUSE
Make sure you update the filename for exiftool too. My camera shoots
.PEFRAW files, yours will likely be either
.NEFYou’ll need to change every instance of
.NEF. Otherwise you’ll get an error.
If you have any trouble with it, just ask, and I’ll try to help you out. It took me a long time to learn how to do all this, but the plus side is, now I have some experience! So don’t be afraid to ask!September 2, 2016 at 10:34 am #18861
OK, @buddingphotographer I took 10 Raw images of the milky way last night. I have raw therapee, but not hugin. What should be my next step. Thanks!September 2, 2016 at 1:41 pm #18862
Download Hugin here: http://heanet.dl.sourceforge.net/project/hugin/hugin/hugin-2016.0/HuginSetup_2016.0.0-win32.exe
Install Hugin. (If you pay attention during installation, you’ll see the path where it’s installed.)
Next, download GMIC here: http://gmic.eu/files/windows/gmic_win64.zip Unzip the folder and put it somewhere where you can find it. If you’re comfortable with copying folders, you could copy it to your Program Files folder. (Don’t try it if you’re not sure how to do it.)
If you want to preserve your EXIF data in the final file, then download exiftool here: http://owl.phy.queensu.ca/~phil/exiftool/exiftool-10.25.zip Do the same as you did for GMIC above, unzip the folder to a place you can find.
September 2, 2016 at 2:49 pm #18863
- Now copy the paths to RawTherapee Hugin, G’MIC, and exiftool and post them here, and I’ll update the script to work for you. To paste a folder path on the Lenspiration forums, use the
codebutton on either side of the path so that it formats it correctly. Like this: “C:\Program Files\RawTherapee-4.2.539\rawtherapee.exe” Otherwise, the forum HTML code will probably mess it up.
- I’ll also need the filename of one of your RAW files from the folder you will be processing. (Something like: IMG_4675.CRW) I need the name and the extension)
OK, Thanks for the info. I’ll try to work on that. But I have a few questions.
1. Some of the above is greek to me, so ummm… you mind explaining paths and the code button.
2. I have G’MIC in GIMP, do I need to download it again?
3. As the extension for the file name, do you mean the (CR2) at the end, or is it something different.
Thanks for explaining, I really appreciate it.September 2, 2016 at 7:35 pm #18864
You’re welcome, hopefully we’ll get it working!
- Paths: The series of folders that you have to go through to find the file you’re looking for. 🙂
- Yes, you need to download G’MIC again, the GIMP plugin is different from the command line program.
- If the last part of your RAW file is CR2, then yes, that’s what I need. I need the whole name though, not just the extension.
This is a path, you can click on it, highlight it, and copy it to the clipboard, from whence you can paste it into the Lenspiration forum.
The code button is here:
Hit “Enter” to make a new line, then hit the
Codebutton one time, then paste your path, and hit the
Codebutton again to close it. You’ll see the instant preview update with a little blue box around the path if you did it right.September 2, 2016 at 9:02 pm #18867
Thanks! What about G’MIC?September 2, 2016 at 9:03 pm #18868
Never mind, I see it now. =))September 3, 2016 at 7:20 am #18869
OK, I downloaded G’MIC, and when I open it, all I get is a little black box with some writing in it??? Any tips?September 3, 2016 at 8:56 am #18870
Yep, that’s right. It’s a command line window. You’re going to be running this script in the command line prompt.
Do you have all the paths yet?September 5, 2016 at 2:48 pm #18884
OK, I’ll try here.
C:\Program Files (x86)\Hugin\bin
OK, looks like it worked. Thanks for doing this for me!
P.S. Something to remember, I don’t know the first thing about Hugin or G’MIC, so please explain. Thanks!September 5, 2016 at 7:51 pm #18906
Here’s the code you’ll need to make this work:
SET rt="C:\Program Files\RawTherapee-4.2.1005\rawtherapee.exe" SET hugin="C:\Program Files (x86)\Hugin\bin\align_image_stack.exe" SET gmic="C:\Users\Jeanette\G'MIC\gmic-1.7.5-win64\gmic.exe" %rt% -b16 -t -w -c EJM*.PEF %hugin% -m -v -a aligned_ EJM_*.tif %gmic% -average_files aligned*.tif -o averaged.tif,ushort DEL EJM_*.tif DEL aligned_*.tif %rt% -w averaged.tif
But before this code will work, I have to have a filename for one of your RAW files. As you can see, my code has “EJM_0076.PEF” in it, which is my RAW filename. I need yours, or the code will fail.
P.S. The nice thing about this script is that you don’t need to know anything about hugin or G’MIC, those 2 programs do all their work behind the scenes, and you’ll never have to do a thing with them!September 5, 2016 at 8:21 pm #18909
Oh yes! Here it is. (IMG_0387.CR2)
So what is my first step… the code doesn’t make sense. =\
Do I do something with the code?
I’m kinda lost. =(
Thanks!September 7, 2016 at 7:54 pm #18936
Ok, here’s the final code:
SET rt="C:\Program Files\RawTherapee-4.2.1005\rawtherapee.exe" SET hugin="C:\Program Files (x86)\Hugin\bin\align_image_stack.exe" SET gmic="C:\Users\Jeanette\G'MIC\gmic-1.7.5-win64\gmic.exe" %rt% -b16 -t -w -c IMG*.CR2 %hugin% -m -v -a aligned_ IMG_*.tif %gmic% -average_files aligned*.tif -o averaged.tif,ushort DEL IMG_*.tif DEL aligned_*.tif %rt% -w averaged.tif PAUSE
Don’t worry, it won’t be hard! 🙂 Here’s a link to download the script: https://www.dropbox.com/s/7gymxg9j4i2t147/canon-raw-stack-average.bat?dl=1
Once you’ve downloaded the script, copy it to the folder where your 10 RAW files are. (Copy the file
canon-raw-stack-average.batto the folder full of RAW files.) Make sure that your folder of RAW files has only the RAW files in it that you want to stack, and nothing else (except the
.batfile of course)!
Once you have 10 RAW files and one
.batfile in that folder, just double-click the
.batfile to run it. You should get
a little black box with some writing in it
Otherwise known as “The Command Line”. 🙂 If everything works out right, the script should run for several minutes, and then it should say, “Press any key to continue…” Pressing any key will exit the command line window. Then you should find a file called
averaged.tifin your folder full of RAW files, and RawTherapee should open that file to be edited.
If you get any errors, let me know what it says, and we’ll try to work through it.September 7, 2016 at 8:06 pm #18938
Wow! Thanks a lot for the help! I am trying to run it now, and I will post the final results.
You must be logged in to reply to this topic.