Infrared Photos In Lightroom
I came across this excellent Gimp infrared tutorial not long ago, and it got me excited to try some infrared photo processing. Being a recent Lightroom addict, I found it annoying that Lightroom does not support color channel mixing, and having to constantly export-edit-import slowed my workflow.
In doing a bit of research on a solution to this, I discovered the magical world of Lightroom plugins! First, I must give a huge thanks to user ST8_ in this Flickr thread about color channel swapping inside Lightroom, where he provides a Lightroom plugin RBSwap that exports a photo to Gimp to swap the red and blue channels.
This was my first experience on the programmer’s side of Lightroom plugins, and sent me on a wild tangent on learning about Lightroom plugin development – reading up on the Lightroom SDK – learning how Lightroom plugins work – and experimenting with my own.
Basically, LR plugins are a collection of Lua scripts that import and use LR SDK libraries, and all have a pretty basic/common structure (for more info read this).
I decided after looking at the examples included with the LR SDK, that ST8_’s RBSwap plugin actually makes a really nice template for exporting photos from Lightroom to another application.
So, as a learning exercise I took ST8_’s Lightroom plugin and re-worked it a bit to use ImageMagick swap the color channels. I leave the the option to choose Gimp or ImageMagick, and do some simple code formatting/cleanup.
RBSwap Installation (on a mac)
- Download the whole Lightroom infrared folder
- Place RBSwap.lrpdevplugin in ~/Library/Application Support/Adobe/Lightroom/Modules/
- Install Gimp and/or ImageMagick
- Edit RBSwapExportServiceProvider.lua to choose Gimp *or* ImageMagick
- ImageMagick (convert) is current default. If using Gimp, place the red_blue_swap.scm script ~/Library/Application Support/Gimp/scripts/
Note: If you want just use the command line for swapping color channels instead of Lightroom, here is how for Gimp and ImageMagick, respectively:
$ gimp -i -b '(red_blue_swap img.jpg )' -b '(gimp-quit 0)'") $ convert img.jpg -set colorspace RGB -separate -swap 0,2 -combine img.jpg
After installing the plugin and restarting Lightroom, simply right click any photo, choose Export > RBSwap
The following is an example infrared image workflow, all done in Lightroom!
Export to PyrDetail
Taking what I’ve learned above, and using the RBSwap as a nice LR4 plugin template, I created another plugin to export photos into my image manipulation app: pyr_detail.
Installation is similar to above, and the path to pyr_detail needs to be modified inside the script (see the Readme). Also note, that this plugin is really just for me, as installing and running PyrDetail is shamefully not as easy as I would like (need to have OpenCV installed, etc), but please try it out!
Here is a video of what that the pyrdetail Lightroom plugin looks like in action:
I just discovered how to make simple plugins for Lightroom, and want to continue learning how to make more with better features.