What do Ansel Adams’ Iconic Images Look Like in Full Color?

A Computational Thinking Story With a Dash of Wolfram Language

Arnoud Buzing
Towards Data Science

--

Image by Ansel Adams for the National Park Service (public domain)

One of my all-time favorite photographers is Ansel Adams. Maybe it is because I was born near the end of the black and white photography era? My earliest baby pictures are all in black and white.

Adams’ sweeping panoramas of the West are simply breathtaking. And although he is mostly known for his black and white photography, he did work extensively with color images.

In 1941, the National Park Service commissioned Adams to create photographs for a mural for the Department of the Interior Building in Washington, DC. The 226 photographs taken for this project are still available from the National Archives and were placed in the public domain.

Image by Ansel Adams for the National Park Service (public domain)

Despite Adams’ preference for black and white photography, he took his photographs from a very colorful world. I have seen examples of old black and white photographs that were colorized with quite interesting results. Very often a picture that seems to be from a distant past becomes much more relatable. I wondered if the same would happen if I took the photographs from the National Archive and colorized those.

Image by Ansel Adams for the National Park Service (public domain)

To start with colorizing images we need an algorithm or function which can guess what the best color for each grayscale pixel is. This can be determined by looking at lots of examples of color images and deducing how surrounding color values determine the color of an individual pixel.

This is a great task for a neural network and, in fact, many such pre-trained neural nets are in existence. The Wolfram Language comes with a really nice repository of neural networks, including ones that can do image colorization.

(image by author)

There are three models to pick from. Two are based on the “ColorNet Image Colorization” neural net, one trained on primarily on images of places, and the other trained on a standard ImageNet competition data set. The third neural net, “Colorful Image Colorization”, is also trained on the standard ImageNet data.

To make it easier to compare the performance of the three neural networks, I wrote a function which accepts one image and one of the three neural net models:

ColorizeGrayscaleImage[image, model]

The three models are:

models = {
"ColorNet Image Colorization Trained on ImageNet Competition Data",
"Colorful Image Colorization Trained on ImageNet Competition Data",
"ColorNet Image Colorization Trained on Places Data"
}

To start off, let’s use the image at the top to compare the three models. Note that in the Wolfram notebook interface you can quite easily include images as part of your code. That’s very convenient!

(image by author)

It’s clear from the output that the second image in the output has some red artifacts in the top left, so clearly that model is not performing well here.

Let’s take a look at another image:

Image by Ansel Adams for the National Park Service (public domain)

This time the second model is actually performing quite well:

Image by author, based on work by Ansel Adams for the National Park Service (public domain)

Here the two different versions are shown side by side:

Image by author, based on work by Ansel Adams for the National Park Service (public domain)

Here is another image with the original image and the three colorized versions shown side by side:

Image by author, based on work by Ansel Adams for the National Park Service (public domain)

There are a lot more images for you to play with. You can do so with this Wolfram Cloud notebook or by using the code at the end of this post.

Finally, here is an image collage that uses the entire archive. Enjoy!🌄

Image by author, based on work by Ansel Adams for the National Park Service (public domain)
Image animation by author, based on work by Ansel Adams for the National Park Service (public domain)

--

--

I create awesome software at Wolfram Research, makers of Mathematica, Wolfram|Alpha, Wolfram Cloud, and many other products and services.