Lightroom plugin cr2hdr v3.0 DEV (WIP)

Started by kichetof, March 18, 2014, 05:04:33 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.


You have to be more specific. Are you enfusing dualiso generated files or are you enfusing other non dualiso footage?
You are aware that enfuse exists as a plugin for lightroom?


Yes.  I've been using LR/Enfuse for a few years now.

Quote from: Danne on December 13, 2016, 09:40:36 PM
You are aware that enfuse exists as a plugin for lightroom?

I just recently started incorporating Dualiso so help speed up my process (shoot less images.  With DISO, I can get away with 3 AEB instead of 5 or 7.

Yes, both.

Quote from: Danne on December 13, 2016, 09:40:36 PM
Are you enfusing dualiso generated files or are you enfusing other non dualiso footage?

Now, my AEB shots are Dualiso brackets.  Basically, I set DualISO to +2EV and then do a 3AEB or 5AEB, to get the entire dynamic range.   Typically (without dualiso) I stack the separate AEB shots, then let LR/Enfurse batch them to TIF.  With Dualiso brackets, I 1st run cr2hrd, then stack, then run LR/Enfuse. 

The idea is to combine both into one process.

Thanks for your help!
Architectural Photography
5D MK3 & 600D | 24-70mm USMII L 2.8 | Nikon 14-24mm 2.8 | Nikon Nikkor 24mm 2.8 AIS & 50mm 1.4 AIS ** Windows 8.1 Pro | 32GB Ram | i7-4770 @ 3.4GHz


I think some bash scripting would solve these needs. First process your files into usable DNG files then group them and enfuse your shots. I have some bash scripts grouping files and enfusing them in MLP, maybe helpful.


Hi everybody!
I'm new here and first off a big thanks to the devolopers for all the effort in this project!
Now,i'm having trouble with the conversion of the dual-iso file,so i need some advice;
what i do is:
1)import in LR the .cr2
2)right click-export-Magic lantern Dual iso converter
than the plugin tells that the file has been succesfully converted and infact in LR appears the dual_iso.dng file(plus the log file in the folder),but here comes the issue, the file is piled with the original(striped) .cr2(which is flagged as rejected) and it is only the lower iso shot,nothing is different from a regular raw file at 100 iso.
Am i missing something?
I'm on win7 64bit, LR cc 2015 ,latest LR plugin ,exiftool and dcraw correctly installed.
Thanks in advance

P.S. i hope that my english is at least understandable ;p

Walter Schulz

Latest plug-in is found here:

Now don't use
Export -> Dual ISO Converter (cr2hdr)
Export -> Export ... -> Preset "Magic Lantern" -> Dual ISO Converter (cr2hdr)
Now you are able to change settings.

Maybe you got the wrong idea about how Dual-ISO works. The converter will generate a single output file.


i've tried as you said,but it' the same.
Yep,i was thinking that dual_iso was some kind of HDRish effect and probably on a 5D Mk III it works great, but i have a 600d...bummer..
Thanks again for the reply

Walter Schulz

It works with all ML enabled cams. I suppose you are doing something wrong or expect something out of Dual-ISO's scope and abilities.
Please share an unprocessed Dual-ISO CR2 and the settings you used in cam's Dual-ISO menu.


Hi,i've been fiddling around with the dual_iso file in LR and i am filnally getting some results now. In the end i was post-processing in the wrong way,'cause i usually don't touch the exposure slider,so i was just trying to pull out the shadow with the shadows slider,obtaining poor results,but working with the exposure and highlights i can see the advantages of the dual iso versus a standard cr2 file.
I used the standard settings for ettr and dual iso because i didn't know what to expect,next time i will try differnt settings.
Thanks again!


For those who are curious or unsure on how to use this plugin for Dual-ISO files in LR on OS X...
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109


Just noticed a strangeness with the latest LR version (3.3) (Win 10).

Although the unflag check box is unchecked, the CR2s are 'returned' from the export with the reject flags on.

Has anyone else noticed this?

Also, I would love a feature that also allowed me to set the CR2 (or DNG) original to a rating star (* to *****), as well as the returned Dual-ISO DNG. This would help those that are stacking to separate out the processed Duals for further work, ie focus stacking.




@garry23 -- did you know that the Lightroom plugin is coded in lua? That's right up your alley.

Last time I had a problem with the plugin I contacted @kichetof and did some of the changes myself.

You don't need to set up a ML development environment to work on this. SourceTree makes it easy though if you're more comfortable with the command line you can use Mercurial SCM.

The plugin can use an update. At least replace the old cr2hdr, dcraw and exiftool with the latest versions.

Walter Schulz

@garry23: Unable to reproduce your error. Please check the version you are actually using in Plug-In Manager. Most recent version is "3.0-BETA3.3".
@dfort: Yes, an update would be nice but there is no MLV_DUMP included in any plug-in version.

All the files for this plug-in are just plain text files (no encryption applied) in Lua. Exceptions are those files in bin: cr2hdr, dcraw and exiftool.


@Walter Schulz

Fixed and this is what was happening.

On downloading the latest Beta3.3 I ran it and noticed the reject flag.

Checked the settings to confirm the checked box was unchecked.

Reran and still had the reject flag set on return.

Went into setting again and set the check on and, of course, got the dual set to reject.

Went back into the settings and unset the check box and reran = no reject flag set.

My problems have gone away, but there may be something in the coding, ie first time it runs.




Quote from: Walter Schulz on January 29, 2017, 03:37:05 PM
...there is no MLV_DUMP included in any plug-in version.

All the files for this plug-in are just plain text files (no encryption applied) in Lua. Exceptions are those files in bin: cr2hdr, dcraw and exiftool.

Right, modified my post.

@garry23 - Not sure how to reproduce this bug. Is this the option you're talking about?

What do you mean by:

Quote from: garry23 on January 29, 2017, 04:19:24 PM
Reran and still had the reject flag set on return.

Do you mean that you had to uncheck, check and uncheck again for that setting to take? I can't reproduce that error either -- I'm on a Mac but the plugin should behave the same.



Yes ;)

In other words, on my Win 10, the situation returned to normal after I had checked run and unchecked and run.

Looks like to me that the check box and the rest of the code was not in full sync when first run.



Walter Schulz

My experience: LR stores plug-in settings and you can't just go back where you started. Removing/"reinstalling" plug-in does not help.
Reproducing such errors is a PITA. I suppose you will need virtual machines to hunt down such bugs.
I'm not an LR developer, though.


@Walter Schulz

Good point, it may have been a transition issue, i.e. Moving to the latest version from the previous one.

Main thing is that things are running as expected.




Hi @all :)

Sorry for my poor contribution last year... many many work and my iMac was very slow to process pictures ... so you know the next, less participation.
For celebrate my come back, I've prepared a new release (always in beta) to test

Download v3.0-170223-01-SLP-DEV

I decided to change the way to number the version display to avoid some confusion with version. I saw a lot of mistakes that was solved, but the users doesn't have the right version.

So now, I display the version number on the first section title (and warn user if it's a dev release).

What's new in this release

(It's not a revolution :P)

Only for Mac users (sorry Win..) you could export the entire path with -same-levels like wildcard use.

I explain more:

If you choose -same-levels, Lightroom will run: cr2hdr --options --same-levels paths\of\image\IMG_001.CR2 paths\of\image\IMG_002.CR2 paths\of\image\IMG_003.CR2 paths\of\image\IMG_004.CR2, everything works fine, but, if you have a lot a pictures, the command length will be enormous and may cause error. So with this new option, you could run --same-levels like: cr2hdr --options --same-levels *.CR2

That's really more sexy!
Why Windows users can't have this new feature ? Like a1ex explains, Windows command doesn't expand to all files... If you try to run cr2hdr.exe --same-levels *.CR2 it will crashes... Maybe we need to compile cr2hdr with Visual Studio to allow wildcard expanded?? (my skills on compilation are very limited and especially in Windows environment). If you have the skill to compile it with Visual Studio... maybe ... :)


Please report all issues to bitbucket repo, I'll be more efficient if I receive mail when a new issue will be create. I always have a lot of work and I need to catch up the delay on my other projects too :)

What's next ?


  • Merge pull request to solve bug with dng file (thanks @SinusPi)
  • Add rating to converted picture Done ! (thanks @NickZee for the idea)
  • Clean the code
  • any ideas ?

Keep plugin up to date

To be sure to run every time the latest version, open Plugin-in Manager (Win: Ctrl + Alt + Shift + , - Mac: Command + Option + Shift + ,) and check the box to reload plug-in on every export.

(As you can see, I forget to read version for this view  ::))

Walter Schulz

About wildcards for Windows ...
Not sure if I'm on the wrong path ... ehm ... but may be there is a solution (IANAP):


@Walter Schulz yeah great new !!

Updated version

Download version 3.0-170304-01-SLP-DEV

What's new?

  • Rate the converted picture
  • Display elapsed time on summary message
  • Added some Library Filter presets (copied in AppData folder)
  • Hopefully fix bug in plugin manager for Windows users

How to update the plugin

Because I added a lot of files, you need to restart Lightroom after replacing the plugin.
(Lightroom doesn't reload every files, like translation files or new Lua files, until you reload Lightroom...)

What's new in future release?

I'll rewrite the way to parse log file to detect "Doesn't look like interlaced ISO" to fix the bug with DNG file. This approach will be more relevant that actually (now I check if DNG output exists --> bug if original file is a DNG).


Diggin' your fine work as always @kichetof and Thanks for sharing!
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109


New release (bugs fix)

If you work with DNG, this release is for you !
Normally (I've done dozens of tests) everything should works as expected!  8)

Download cr2hdr.3.0-170305-02-SLP-DEV

If you encounter some bugs, please explain me everything you do (name of files, settings in export plugin, etc).

If no bug, I'll clean the code and release a final version of 3.0 !


Your plugin don't support 10-bit raw ml video from 650d. Settings default.

Link to source files:
Raw Video and first frame.
650d.104 ML • SX1.200h CHDK


Hi @k2121,

When I run cr2hdr in standalone, I can't convert your file:

cr2hdr.exe --amaze-edge --cs2x2 --no-bad-pix --fullres --alias-map --stripe-fix --wb=graymax "G:\Tof\Photos\Photographies\Magic Lantern\Dual ISO\Bug 10bit\M04-142700000.dng" > "G:\Tof\Photos\Photographies\Magic Lantern\Dual ISO\Bug 10bit\M04-142700000-dualiso.TXT"

cr2hdr: a post processing tool for Dual ISO images

Last update: ab1e90c on 2015-11-24 09:50:19 UTC by a1ex:
cr2hdr: moved safeguard from median_int_wirth to kth_smallest_i...

Active options:
--amaze-edge    : use a temporary demosaic step (AMaZE) followed by edge-directed interpolation (default)
--cs2x2         : apply 2x2 chroma smoothing in noisy and aliased areas (default)
--no-bad-pix    : disable bad pixel fixing (try it if you shoot stars)
--wb=graymax    : set AsShotNeutral by maximizing the number of gray pixels (default)

Input file      : G:\Tof\Photos\Photographies\Magic Lantern\Dual ISO\Bug 10bit\M04-142700000.dng
Camera          : Canon EOS 650D
Full size       : 1280 x 692
Active area     : 1280 x 692
Black borders   : N/A
ISO pattern     : dBBd RGGB
White levels    : 10000 5000
Noise levels    : 8.00 8.00 8.00 8.00 (14-bit)
Doesn't look like interlaced ISO
ISO blending didn't work

As I see, cr2hdr doesn't like your file and LR report this is not a Dual ISO File and add no Dual-ISO keyword.

Which version of cr2hdr do you use normally ?


mlv_dump.exe M04-1427.MLV --dng --no-fixcp --no-stripes
cr2hdr.exe M04-1427_000010.dng

=> all OK.

Other MLV converters (or older versions of mlv_dump) may not promote the 10-bit data to 14-bit. This step is required for running cr2hdr, as it has some parameters hardcoded for 14-bit input.