Lightroom plugin cr2hdr v3.0 DEV (WIP)

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kichetof

Lightroom Dual ISO Plugin

This plugin allows you to convert Dual ISO picture from Lightroom directly to cr2hdr tools.

Lightroom v4 and more is needed.









How to use:


  • Default settings
    • Right click on one or multiple selected pictures
      • Select : Dual ISO Converter (cr2hdr) (this option uses default settings, see below)
  • Custom settings
    • Launch the Export Window
      • Right click on one or multiple selected pictures
        • Export selected photo(s)
      • Shortcuts
        • Windows: Ctrl + Shift + E / Mac: Command + Shift + E
    • Change what you want



Default settings:

> Plugin settings:

  • Add suffix -dualiso to the output file
  • Synchronize keywords with original picture
  • Reject original picture (flag unmarked)
  • Add converted file to all collections of the original
  • No subfolder
  • Show summary message
  • Keep log file
  • No keywords added by user (Dual-ISO is added by cr2hdr)
  • No label defined
> cr2hdr settings:

  • --amaze
  • --cs2x2
  • --no-bad-pix
  • --fullres
  • --alias-map
  • --stripe-fix
  • --wb=graymax (cr2hdr 20bit)
This plugin is translate in english, french, german, portuguese and swedish. (feel free to send me a translated file).




/!\ DEV /!\ Download the lastest version of Lightroom Dual ISO Converter (cr2hdr) plugin (dev version).




How the plugin works:

  • Pictures selected to export are listed
  • Only CR2 and DNG files are supported (if file is not present, skip)
  • Each picture, one by one is converted with cr2hdr (with defaults or custom args)
    • if cr2hdr 20bit and --same-levels are selected, all pictures are converted in the same time
  • Picture is moved to subfolder
  • Picture is renamed with suffix
  • Picture is imported into Lightroom catalog
  • Label is added
  • Keywords are added (and created if needed)
  • Synchronize keywords with original file
  • Keyword Dual ISO raw or no Dual ISO is added to original file
  • Parse log file to fill metadata with cr2hdr results
  • Add picture to all collections
  • Keep or remove log file
  • Set the flag of the original file



How to install this plugin:

To install this plugin, extract zip and save folder cr2hdr.lrplugin where you want.
(Don't use hyphen mark "-" in path. This is an Adobe bug.)

On Lightroom, open the Plug-In Manager (shortcut Win: Ctrl + Alt + Shift + , (comma), Mac: Command + Option + Shift + , (comma)) and install it.

You can follow instructions from Adobe.




Follow the projet on Magic Lantern Forum.

Contribute to the code on Bitbucket.

This plugin is distributed under the GNU GPL v2.




Changelogs:

2014-09-30 v3.0 BETA 3

  • fix bug with cr2hdr command on windows
2014-09-22 v3.0 BETA 2

  • fix bug with subfolder
  • fix bug with same-levels
2014-09-13 v3.0 BETA

  • Rewrite processing (no unnecessary export)
  • Update cr2hdr 20bit to 0eabcb0
  • cr2hdr 20bit --same-levels argument supported
  • Added keywords Dual ISO raw or no Dual ISO to original file (speedup process and sorting in LR)
  • Synchronize keywords with original file
  • Convert tabs with 4 space
  • fix some bugs
  • (change editor text: Brackets before Smultron/TextMate)
  • (change Mercurial CLI to GUI: TortoiseHG for Mac)
2014-04-21 - 2014-09-12 v2.2 BETA

  • Added cr2hdr args
  • Added cr2hdr 20bit support
  • Added metadata with cr2hdr results (big thanks akry)
  • Added keywords
  • Added color label
  • Added flag rejection
  • Restore default plugin settings
2014-03-27 v2.1

  • Export to subfolder
  • redesign ui
2014-03-26 v2.0.2

  • Correct portuguese translation (thanks Luiz)
2014-03-26 v2.0.1

  • Remove extern functions
  • Works on Windows
2014-03-25 v2.0

  • New export window
  • DNG file supported
  • Custom user settings (suffix, label, add to collection, remove logfile)
  • Mac: check dependencies
2014-03-19 v1.0.3

  • Fix multiple instance of cr2hdr (thanks Rob Cole from Adobe forums)
2014-03-19 v1.0.2

  • Add portuguese translation (thanks Luiz Roberto dos Santos)
  • Change output name (solve fotogemeinschaft_de problem with export name)
2014-03-19 v1.0.1

  • Add german translation (thanks g3gg0 et Walter)
  • Update dcraw (9.20) and exiftool (9.54)
  • Windows command run without CMD visible (thanks chris_overseas)
2014-03-18 v1.0

  • First release (Mac fully compatible, Windows need some optimisation)

Marsu42

Quote from: kichetof on March 18, 2014, 05:04:33 PM
I've the pleasure to share with you my first Lightroom plugin!

Thanks, that certainly improves usability for newbies and people who keep the cr2 and dng in the same place. Still, with acr the dual_iso auto wb is broken so this workflow isn't without problems atm.

Danne


a1ex

Quote from: Marsu42 on March 18, 2014, 05:13:12 PM
Still, with acr the dual_iso auto wb is broken

IIRC you were the one researching this problem, along with engardeknave: http://www.magiclantern.fm/forum/index.php?topic=10265

Did you check if converting CR2's to Adobe DNG before running cr2hdr helps? Did you try to copy the exif info from an Adobe DNG file to cr2hdr output? I remember asking you this stuff, but I don't remember your answer (and my LR demo expired).

Danne

Wonderful little plugin. Don,t understand wb problem? Converted/exported my cr2 directly and it gave me superb result after processing my dng in lightroom. Perfect being able to work with dualiso straight within lightroom. Very convenient. Big thanks!


g3gg0

a big lol from my side when reading that post. why?

tonight i sat in front of the adobe SDK because i wanted to make dual iso files usable straight out of LR.
the intermediate step was just too inconvinient if you gave a graphical workflow.
then i decided, this is not a simple task if you never made a LR plugin. so i stopped since i didnt want to spend a week.
(i thought the right way is to generate a proxy file and using custom extensions)
i hoped that someone would come up with a proper solution.

and three hours after i stopped reading the SDK and example plugins you posted exactly what i was looking for.
wow, this was a perfect timing :)

thanks for this cool plugin, im gonna try it!
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

Danne

It is awesome.
My workflow
1 - importing the folder with dual iso cr2 files and I rate all of the 1 star(for being able to differ the originals from my resulting dngs)
2 - export to dng with the plugin
3 - back into the folder I choose to show "unrated" pictures and I end up with only my dng,s. Awesome indeed!
So nice.

*Of course one could simply point the dng,s to a specific folder to have the exported separately from the originals. Even better than above workflow

g3gg0

first feedback:

- Lightroom 4.4
- Windows 7 x64, German
- installed cleanly
- "C:\Program Files\Adobe\Adobe Photoshop Lightroom 4.4\cr2hdr.lrplugin"
- .lrcat path contains spaces too
- images are in path without spaces
! exporting fails with error message that that was no dual iso file
-> problem was the binaries not being found - placed in a %PATH% directory and it works
-> edit: i restarted LR and removed cr2hdr from the %PATH% directory and it suddenly works ... (?!?!)
! logfile per image "dualiso_xxxx.txt" is created, but empty
-> didnt check yet where it comes from :)

conclusion:
aside from the mentioned install trouble a damn cool plugin which will push dual_iso a lot.

here the german translation:
http://upload.g3gg0.de/pub_files/cf7f49e55e19749234d19593907c5785/TranslatedStrings_de.txt
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

Danne

I put the plug in straight to the lightroom plugin folder.
Rightclick program "lightroom" go to show package contents to contents to plugIns folder and put the plugin in there. Works straight away on mac.

Walter Schulz

Quote from: g3gg0 on March 18, 2014, 09:01:48 PM
here the german translation:
http://upload.g3gg0.de/pub_files/cf7f49e55e19749234d19593907c5785/TranslatedStrings_de.txt

Verbesserungsvorschlag:
"$$$/ML/Publish/noDualIso=Das Bild ^1 scheint kein dual ISO Bild zu sein"
->
"$$$/ML/Publish/noDualIso=Das Bild ^1 scheint kein Dual-ISO-Bild zu sein"

Ciao
Walter

g3gg0

Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

chris_overseas

- Lightroom 5.3
- Windows 7 x64, English
- Installed fine from a separate directory (F:\Lightroom\Plugins\cr2hdr.lrplugin)
- Images are in a path that contains spaces
- Selected several images, right-clicked and exported, everything worked fine!

Note that I copied over new versions of cr2hdr.exe (I used the 20 bit version), exiftool.exe (9.54) and dcraw.exe (9.20) since the included ones appear to be quite old?

Bugs/issues:
- I get an empty log file for each image (as pointed out by g3gg0)
- The cr2hdr command line window opens in the foreground (is it possible to open it minimised, hidden or behind Lightroom?)
- The DNGs were created fine and the corresponding CR2 says it is in a stack, but the DNGs don't appear in the filmstrip or library (grid) view. [OK, turns out that's because I had just imported the CR2s then exported directly, so my library selection was "Previous import" rather than the folder I'd imported. I don't think that can be considered a bug?]

Overall, this looks great and will definitely simplify my workflow. Thank you!
EOS R5 1.1.0 | Canon 16-35mm f4.0L | Tamron SP 24-70mm f/2.8 Di VC USD G2 | Canon 70-200mm f2.8L IS II | Canon 100-400mm f4.5-5.6L II | Canon 800mm f5.6L | Canon 100mm f2.8L macro | Sigma 14mm f/1.8 DG HSM Art | Yongnuo YN600EX-RT II

garry23

A simple report that this plugin works perfectly: well at least in my set up, ie LR5.3 and 64bit Win7.

I just right click on the image and select cr2hdr and magically the DNG returns to Lightroom, I don't even need to synchronize the folder in library view as I need to do with some plugins.

It means that we now have 1-click processing of dual-ISO.

Many thanks to the author of the plugin.


Danne

All my logfiles (.txt files) contain all infomation about the conversion process. No one is empty.
I,m on a mac and lightroom 4.4

example from logfile:

"   1 image files updated
cr2hdr: a post processing tool for Dual ISO images

Last update: 310e39f on 2014-02-27 05:17:41 UTC by 1p:
Fix ISOs in dual ISO

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)

Input file      : /Users/itguser/Desktop/desktop/cr2hdr/ML/dualiso_5715.cr2
Camera          : Canon EOS 5D Mark III
Full size       : 5920 x 3950
Active area     : 5796 x 3870
White level     : 12500
Black borders   : 124 left, 80 top
Black level     : 1963
ISO pattern     : BddB RGGB
Noise levels    : 10.65 6.20 6.19 10.53 (14-bit)
ISO difference  : 3.98 EV (1580)
Black delta     : 3.96
Dynamic range   : 10.73 (+) 9.95 => 13.93 EV (in theory)
Looking for hot/cold pixels...
Hot pixels      : 1155
Cold pixels     : 487
AMaZE interpolation ...
Amaze took 6.27 s
Edge-directed interpolation...
Semi-overexposed: 23.77%
Deep shadows    : 66.49%
Horizontal stripe fix...
Full-res reconstruction...
ISO overlap     : 3.8 EV (approx)
Half-res blending...
Chroma smoothing...
Building alias map...
Filtering alias map...
Smoothing alias map...
Final blending...
Noise level     : 2.45 (16-bit), ideally 2.45
Dynamic range   : 14.07 EV (cooked)
Black adjust    : 0
Output file     : /Users/itguser/Desktop/desktop/cr2hdr/ML/dualiso_5715.DNG"

kichetof

Thank you all for your feedback! I appreciate :)

I'm glad that this plugin makes your workflow easier!!

So, my workflow is Mac and it's really more simple to write shell command on it!

I spent a lot of hours to find a way to launch the command on windows and I'll find a way to optimise it! (see my post on dev ml forum and Lightroom discussion)
To windows users:

Could you add before LrTasks.execute (where cr2hdr.exe is call): mlLog:debug(command)
And paste result from windbg or anything else debugger

Could you add /B and/or /MIN after /WAIT on windows command var and tell me if it's more user friendly

Normally all path are escaped so I don't understand why you don't have output file!

I'll update dcraw and exiftool (forget to commit new version)

Thank you for deutsch translation! :) I'll add it tomorrow

If you're a pro with lua and Lightroom sdk feel free to help me to make code more robust :)

kichetof

Quote from: g3gg0 on March 18, 2014, 08:28:53 PM
a big lol from my side when reading that post. why?

tonight i sat in front of the adobe SDK because i wanted to make dual iso files usable straight out of LR.
the intermediate step was just too inconvinient if you gave a graphical workflow.
then i decided, this is not a simple task if you never made a LR plugin. so i stopped since i didnt want to spend a week.
(i thought the right way is to generate a proxy file and using custom extensions)
i hoped that someone would come up with a proper solution.

and three hours after i stopped reading the SDK and example plugins you posted exactly what i was looking for.
wow, this was a perfect timing :)

thanks for this cool plugin, im gonna try it!

I'm happy to help you! For one time it's me who can help you!

chris_overseas

(For those wanting to play with the plugin code, make sure you go into LR's Plugin Manager and enable "reload plugin on each export" so your changes to the script are picked up and recompiled each time it runs)


  • /MIN works nicely - the window still opens but is minimised so doesn't cause any real problems.
  • /B works without any window appearing at all but ONLY if /B appears before /WAIT. If /WAIT is first the /WAIT seems to be ignored and I get "Doesn't look like interlaced ISO" (http://superuser.com/questions/355341/windows-start-wait-b-not-working).
  • The log file is empty because the shell running "start" is having its output redirected to the logfile rather than the window that is opened by "start" (which is where the real output is). Passing "dualiso.cr2 > dualiso.log" through as a single parameter doesn't work. What does work is escaping the redirect with ^> instead.

Personally I prefer /B over /MIN. I also added /BELOWNORMAL to reduce the cr2hdr priority slightly and help keep the computer responsive.

Here is the updated code incorporating the above changes:

command = string.format('"start /D "%s\\bin" /B /WAIT /BELOWNORMAL cr2hdr.exe "%s" ^> "%s""', pluginPath, filePath, output)


I wonder if there is a way to run multiple cr2hdr conversions in parallel? Also since I'm not really interested in having the log files left behind, I've removed that feature from my copy. Maybe there's a way to make it optional. I know additional settings can be added to the Plugin Manager dialog though I haven't looked into how to do that yet.
EOS R5 1.1.0 | Canon 16-35mm f4.0L | Tamron SP 24-70mm f/2.8 Di VC USD G2 | Canon 70-200mm f2.8L IS II | Canon 100-400mm f4.5-5.6L II | Canon 800mm f5.6L | Canon 100mm f2.8L macro | Sigma 14mm f/1.8 DG HSM Art | Yongnuo YN600EX-RT II

mad.eos

A huge thanks from my part kichetof! You're the man!

This has, in my opinion, turned a whole new leaf in the post processing workflow for whoever works with lightroom!

Very good work! ;)

By the way, have you already updated your zipfile with the new cr2hdr files?
Canon EOS 1100D w/ 18-55mm | ML Nightly Build Tester

Luiz Roberto dos Santos

This will be very helpful, big thanks.
So, this is on Half-res blending mode? Any chance to apply blending full-res? 0k, that requires Octave, but it could be done. Moreover, as mentioned above, perhaps the new features of 20bit version and "film-curve" could help.
I will test soon and bring you the feedback. Also, try to do the translation into Portuguese - BR.

painya

This is not to the ML Gurus.
To the beginners!
Here is a quick user friendly guide-
Open LR
File>Plugin manager
Click on the folder
Restart LR
Right click on your image
Export>ML>Cr2_hdr (or whatever it is)
Enjoy!
Good footage doesn't make a story any better.

Danne

Quote from: chris_overseas on March 19, 2014, 12:35:04 AM
I wonder if there is a way to run multiple cr2hdr conversions in parallel?

I just ran exports in several export operations. Tried running 5 exports simultaneously of cr2 to dng and they work in parallell that way. Occassionally I get a pop up window telling me an internal error has occured but it exports anyway so I just ignored and synchronized the folder when finished.

The error code


*It appears the error code does indeed affect some pictures only getting halfway through the process so Running several export operations simultaneously isn,t stable.

kichetof

Quote from: chris_overseas on March 18, 2014, 09:46:44 PM
Note that I copied over new versions of cr2hdr.exe (I used the 20 bit version), exiftool.exe (9.54) and dcraw.exe (9.20) since the included ones appear to be quite old?

Updated !

Quote from: g3gg0 on March 18, 2014, 09:01:48 PM
here the german translation:
http://upload.g3gg0.de/pub_files/cf7f49e55e19749234d19593907c5785/TranslatedStrings_de.txt

Thanks for this translation!

Quote from: chris_overseas on March 19, 2014, 12:35:04 AM
Here is the updated code incorporating the above changes:

command = string.format('"start /D "%s\\bin" /B /WAIT /BELOWNORMAL cr2hdr.exe "%s" ^> "%s""', pluginPath, filePath, output)


Yeaaaah !! Big thanks for that !!! (I'm more comfortable with a shell terminal)

Quote from: chris_overseas on March 19, 2014, 12:35:04 AM
I wonder if there is a way to run multiple cr2hdr conversions in parallel? Also since I'm not really interested in having the log files left behind, I've removed that feature from my copy. Maybe there's a way to make it optional. I know additional settings can be added to the Plugin Manager dialog though I haven't looked into how to do that yet.

I don't know how to make it, but I'll read the lightroom SDK to find it :)

Quote from: Danne on March 19, 2014, 08:12:14 AM
I just ran exports in several export operations. Tried running 5 exports simultaneously of cr2 to dng and they work in parallell that way. Occassionally I get a pop up window telling me an internal error has occured but it exports anyway so I just ignored and synchronized the folder when finished.

The error code


*It appears the error code does indeed affect some pictures only getting halfway through the process so Running several export operations simultaneously isn,t stable.

Thanks for this try ! I'll investigate how to make it possible!

New version 1.0.1, I'll update first post soon !

Marsu42

Quote from: a1ex on March 18, 2014, 06:36:39 PM
IIRC you were the one researching this problem, along with engardeknave: http://www.magiclantern.fm/forum/index.php?topic=10265

Well, he was researching it a bit and quickly came to the conclusion I arrived at even w/o some days of trial & error - it's too complex for us to figure out the algorithm how acr arrives at its wb values from the tags embedded in the cr2 :-(

Quote from: g3gg0 on March 18, 2014, 08:28:53 PM
thanks for this cool plugin, im gonna try it!

Maybe you can figure out to get the correct "as shot" wb from acr? This is a real pita, if you didn't shoot a wb/color card or a non-dual_iso shot to compare it's complete guesswork what the correct wb/tint is.

fotogemeinschaft_de

After the first export (which was ok) I always get the following error with every other Picture:

'Already treated' - 'The File xy has already converted to dual iso'
(LR 5.2)

In fact the file was NOT converted.

I have found the reason for this behaviour by myself: The plugin doesn't add numbers to the converted files; my filenames are rather long and the plugin therefore produces always the same filenames in the same directory.

After every single conversion I have to rename the converted file manually. A batch-job will therefore not be possible but nevertheless the integration in LR is great..

Ralf
Please visit my www.fotogemeinschaft.de - 30.000 pics

vertigopix

Thanks for this plugin !   :)
Checked you version 1.0.1 and working perfectly for me (LR 5.3 64bit, Win7 64)

Great job !