Photography, Software

Emulating Kodak Aerochrome Infrared Film with Python Image Processing

What is Aerochrome film? It is an analog film stock that is sensitive to infrared light and uses false-color reversal to express infrared light as a visible color. Infrared (IR) light is invisible to the human eye but is all around us and be felt as heat. All objects in the universe emit some level of infrared but the main sources are the sun and fire. One common household use is in TV remotes, as a method of communication, where the remote sends information as pulses of IR light.

This film is intended for various aerial photographic applications, such as vegetation and forestry surveys, hydrology, and earth resources monitoring where infrared discriminations may yield practical results. This is because living plants are good reflectors of infrared light. This means that it was easy to pick out man-made structures in dense vegetation and camouflaged to the naked eye. This lent the film to be used as an information-gathering tool on the battlefield. Now far removed from the original application this film was discontinued by Kodak in 2009 and probably would have stayed there if not for the popularization of its look by the photographer Richard Mosse. A good introduction and background to Aerochrome film is “The Surprising True Story of Kodak Aerochrome” which can be viewed on YouTube.

Now due to the fading film industry specialized films like this are increasingly difficult to get ahold of. Even if you spend good money from an eBay seller it’s likely to be well expired. This means the stability of the film is in question and could give unpredictable exposures.

I first started getting interested in the effects of infrared on photography when I purchased my Leica M8. This first iteration of a digital camera from Leica had an unintended side effect due to the CCD sensor’s sensitivity to infrared light. This causes vegetation that reflects infrared light to show up as a reddish shade of green in the resulting images. You can easily get an IR cut filter to resolve this but I think it gives the images a unique look, a more vintage feel. This can be seen in one of the images I took at Gilroy Gardens.

An even better example of the effects of IR on the Leica M8 is this next image, where the black hat and dress are represented red as they reflect the IR light being cast from the fire.

Yes, that hat is really black!!!

While learning more about Aerochrome I came across this wonderful article on how to simulate the false-color film effect on your digital images using Photoshop. This article describes one method for simulating the effect but I was curious if I could use similar processing but using python.

Python Image Processing

I have been enjoying using Jupyter Lab for experimenting with Python processing for quite some time. This project will use a Jupyter Notebook to perform the processing on a single image. You can then change the image path as needed to process another image.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

I tried my best to copy the same processing that was done in Photoshop, but some of the functions I could not find one-to-one equivalents. Therefore, I used a similar pipeline of first inverting the original image. Then I turned off both the red and the green channels of the inverted image. This left me with just the blue channel on the inverted image.

From there I used the convert color function of the OpenCV (cv2) library to change the color representations from the BGR (Blue, Green, Red) to HSV (Hue, Saturation, Vividness). This allows me to do a Hue blend or weighted addition as it’s known in the cv2 library of the original and the inverted blue channel images. From that, we can take the results of that blend and apply them to the original image hue channel. Then the only thing left to do is convert the color back to the original BRG and save the output as an RGB image.

You can play around with the blend parameters as well as turn on and off different color channels to produce all kinds of different false-color emulations. But I think I have stumbled across a decent method for auto-conversion. Basically, I just created my own “filter” as they would call it on different apps like Instagram. This code along with a test image is available through the GitHub link below.

GitHub: Python Aerochrome Film Emulation

Results

Here are just two of the resulting images, with the before on the left and the after on the right. I can’t believe how good these look! A gallery of all of the images I processed with post-editing will be linked from my Instagram profile at the end.

Comparison

I also processed the same starting image that was processed using Photoshop in the article to see how close my method was to theirs. The comparison is shown below with my results on the left and the articles on the right. Pretty close but with some obvious differences. One thing is the hue of the red, mine is much deeper and more saturated while the one from the article has a more natural and soft look. This is most likely due to the fact that my blending method is a bit more primitive than the one Photoshop is using. But I think I could adjust this in post-processing.

Post Processing

The Python processing does not have to be the only thing you do to the image. I have always tweaked my images in post using traditional photo editing software like Lightroom, Darktable, or even just the Photos App on my Mac. But recently I have been enjoying using the Darkroom iOS app on both my iPhone and iPad Pro. I can quickly import my images off my SD card to the app, where I can adjust exposure, brightness, saturation, etc with sliders. I especially like it on the iPad where the Apple pencil makes editing a breeze.

Darkroom IOS App

Most of the processing I did here was to try and match the resulting images the best I could to each other and add some grain effects to make the images look a bit more like a true film image.

Next Steps

one big issue with this processing is that other sources of green in the image turn red, and red turns green. In true IR photography this would not happen so I would like to add more features or smarts to this simple image processing effect. This could involve using the unique characteristic of my Leica M8’s IR sensitivity to extract the IR light and make a more true-to-film emulation. I also might want to employ better color tracking and perform some kind of estimation or AI to only affect the vegetation, not other sources of green in the image.

I use Instagram for almost all of my photography so I posted some of my favorite images that I created during this exploration into image processing and film emulation. Check them out and hit the heart if you enjoyed them or this blog post.

Shoot Aerochrome on iPhone

If you liked this post and want to try shooting some Aerochrome-like film on your iPhone consider purchasing my 36Exp film camera app now available on the iOS App Store!

iOS App Store: 36Exp