Home » photoshop

I’ve been asked how to take colorful landscape photographs a couple of different times, and ended up writing an answer on Quora and republishing it here. It’s always best to get the shot right in the camera versus focusing on post-processing. While I always shoot RAW as that gives me the most leeway to fix anything later and add artistic effects, it’s a bad habit to rely on later RAW processing to fix things you can get right in the camera.

The good news? There are two common reasons for washed out, low contrast images, and only one extra trick that’s worth knowing to get vivid, colorful photographs.

1. Exposing for colorful photos

Exposure is the most common error, so I will cover that first. We need to expose for the mid-tones of the image to get saturated colors. Highlights and anything at the right of the luminance histogram tend to white. The more over-exposed your image, the lighter the colors and the more washed out it looks.

For example:

Washed out photograph that isn't colorful

This landscape is properly exposed per the camera, but looks washed out. The histogram shows that the pixels are bunched up to the right, with lots of high RGB-value pixels:

Luminosity histogram for washed out photograph

High RGB-value pixels are basically shades of white, the opposite of saturated colors, so the histogram shows that the image is washed out because it is mostly composed of white-ish pixels. We can reduce the exposure value (EV) to fix this at capture: the simplest way is to use the exposure compensation dial, but a reduction of ISO, shutter and/or aperture will work too.

Here’s that same scene about -2 EV from the previous image:

Vivid, colorful landscape photograph

And here’s the histogram with the actual exposure values for this image:

Luminosity histogram for colorful vivid photograph

Now you can see that there is a little clipping in the blacks (that’s what the red triangle at the top-left indicates) and we have also have no pixels at all with high luminance (the gap between the blue pixel “mountain peak” and the right-hand edge of the histogram shows this). Technically, this picture is not exposed correctly — some detail is being lost in the darkest shadows, and we’re not using the full range of the sensor. But that’s why photographers make exposure decisions, not cameras. The second image conveys the saturated colors of the lake and the trees, and we don’t care about the lost shadow detail in the lakeside on the right.

Now that we understand where saturated colors come from, we can understand why we’d use other exposure-reducing techniques like filters (see below). But first…

2. Bad light

The second most important reason for lack of saturation is taking a photo in bad light. Typically the worst light is at noon, because illuminated surfaces are going to tend to white as they’re getting a lot of light from the fiery orb in the sky. If you compensate for this in exposure, the shadows will simply be black because the camera sensor cannot capture the enormous light difference between the two. So, take the photo when the light is softer and the dynamic range can be captured by the camera.

The photographer Syl Arena (https://sylarena.com/) summarizes this well: “If you want to create interesting light, you have to create interesting shadows.”

This is why landscape photographers scout the location to understand where the sun will be and what path it will take, and have smartphone apps that tell them sunrise and sunset at that location. Get up early for soft morning light, know when the “golden hour” is when the setting sun washes the scene with warm light, and learn how to use the “blue hour” after the sun has set.


Vivid colorful landscape photograph taken at in the golden hour

Early morning:

Colorful vivid landscape photograph taken in the morning

Notice the very different moods of the same scene captured at different times of the day. Think about the emotion you want to evoke.

And this is just ambient light. There’s also a whole world of lighting for photography using strobes (flash) and, increasingly, continuous lights that can help you create interesting light and interesting shadows.

If we can get good exposure and good light, then we are 90% of the way there, and can now look at getting the last 10% of saturation and contrast possible at capture.

3. Filters

All landscape photographers have at least one polarizing filter. It cuts out reflected light, which has the effect of cutting haze in a landscape image and really making clouds “pop”. Reducing reflected light also increases contrast and saturation. All modern cameras use circular polarizing filters. You should get one for each of your landscape lenses.

Note that the effect of a polarizing filter is one thing that cannot be fixed later in RAW processing. I know, I know, there are “haze cutter” presets/actions for Lightroom and Photoshop but they basically work by fiddling with the local contrast in an image. The polarizing filter globally screens out light you don’t want in your image, and that isn’t possible to take out in post.

You can also buy “graduated neutral density” filters. You can use these to selectively reduce exposure for situations where a standard exposure would blow out some portion of the image — the sky for example — while the rest of the image (and those mid-tones) is properly exposed. Neutral density (ND) filters are basically translucent gray glass or plastic. They simply block some amount of the light passing through them. Graduated neutral density filters are clear on one edge and gray on the other, with a change in opacity of the filter.

Picture of three different types of graduated neutral density filters

These are examples of fairly sharp changes, but you can also buy filters with a more gradual transition from grey to clear. Using a filter holder mounted on the end of your lens, you can position the clear part of the filter on the part of the image that you’re exposing for, and use the grey part on the sky or whatever needs to come down in exposure.

You can get a very similar effect as a graduated ND filter in RAW processing. Basically it’s an exposure gradient applied to the image. It isn’t as good as doing it at the time you take the shot, because it is limited to the exposure leeway of the RAW file (typically 2.5 EV) and it introduces more noise into the image.

Here’s an example of using a graduated ND filter. Without the filter, the sky is pretty boring while the chapel and graveyard are well exposed:

Vivid colorful landscape photograph without good sky

And after, the graduated ND filter reduces the sky exposure revealing some interesting clouds and saturated blue sky. It’s also giving us more saturation in the red color of the chapel roof line:

Vivid colorful landscape photograph using neutral density filter

Both of these were taken with a polarizing filter, which is why the cloud texture is so visible in the sky, and it helps increase the overall contrast of the image.

I process my images using a combination of Adobe Lightroom and Photoshop, in common with just about every other photographer on the planet. To maximize time spent behind the camera, much of the Photoshop work is automated using Actions, which are a way to record and playback a sequence of Photoshop commands. In other programs such as Microsoft Word or Excel, these are called macros.

Actions are a way of automating Photoshop processes that are performed frequently, but they have one fundamental limitation: there is no way for an action to make a decision by evaluating some condition and doing something different based on the result.

For example, a Photoshop action might downsize an image by 10%. Using the Batch feature of Photoshop, you could apply that action to all images in a folder. However, if you want to downsize only those images in the folder that are larger than, say, 3000 pixels on the longest side, actions and batching can’t help you. There’s no way for an action to evaluate a condition like “longest side > 3000 pixels”. This is where scripting comes in — you can write a small program (the script), that interacts with Photoshop to perform more complex tasks. Although it might not sound like it, scripting is a form of programming. There is no getting around the fact that you have to learn something about how to write programs to use scripting, and this is its disadvantage compared to Actions.

Photoshop has been “scriptable” since version 7, but scripting support has gotten much better since Photoshop CS2. You can use AppleScript, Microsoft Visual Basic, or Javascript. Some people like to get into language “wars of religion” — I will say only this: Javascript is the only language that works across PC, Mac or UNIX, and this is a good reason for preferring it, but my primary motivation was efficiency. I chose Javascript because I had learned to program in C and Java. Despite its name, Javascript has very little in common with Java, but both Java and Javascript have very similar syntax to the languages C and C++.

If you are going to do any Photoshop scripting, there are two very helpful PDF documents you need to read. Fortunately, they are installed on your hard drive by the Photoshop installer. The Photoshop Scripting Guide and the Javascript Reference Guide are both in the Photoshop program directory. I won’t re-hash those documents, but will provide an example that you can pick apart to figure out how to write your own scripts.

An example script: saving image metadata as XMP files

Some Photoshop commands cannot be recorded as Actions, such as some “File Info” (metadata) changes. Metadata (literally, “data about data”) are things like the caption, keywords, title and other information about an image, accessed through the “File Info…” on the File menu. This data is stored as an XML document inside of the image file by Photoshop. The flavor of XML that Photoshop stores is called XMP, and you can save, load and append .xmp files to images using the Advanced panel of the File Info dialog box. The problem is that you can’t record saving and loading XMP files in an action. I wanted to use the XMP data in another program to automate keyword display on my web site, so I ended up writing a Javascript program to automate this function.

The code below scans a folder full of JPEG files and outputs the XMP file for any image that has metadata. It is commented, and in conjunction with the documents from Adobe, you ought to be able to understand how the program works, and perhaps adapt it to your own needs. This code is provided free, and purely for its educational value. Enjoy!

// Output xmp.js
// (c) Copyright 2004 Mathew Lodge
// Rev 2, 02-Mar-2004
// This script prompts the user for an input directory, which contains JPEG source images.
// It outputs one .xmp metadata file per image, unless the file has no XMP metadata.

// Uncomment the next line to show the debugger
$.level = 1; debugger;

// Save current dialog preferences
var startDisplayDialogs = app.displayDialogs;

// Don't display dialogs
app.displayDialogs = DialogModes.NO;

// Constants
var FILE_TYPE = ".jpg"; // The type of files that this script works on -- you can change
var SEARCH_MASK = "*" + FILE_TYPE; // Image file filter to find only those files
var XMP_TYPE = ".xmp"; // File extension for XMP output files
var MAC_XMP_TYPE = "XMPT"; // Macintosh file type for .xmp files
var MAC_XMP_CREATOR = "8BIM"; // Macintosh file creator for .xmp files

// Set of exception strings for error handling
var X_NOINPUT = "noInput";
var X_BADDOC = "badDoc";
var X_WERROR = "writeError";
var X_CERROR = "closeError";

try {
	// Ask user for input folder
	var inputFolder = Folder.selectDialog("Select a folder to process");
	if (inputFolder == null)
		throw X_NOINPUT;

    // get all files in the input folder
	var fileList = inputFolder.getFiles(SEARCH_MASK);

	// Open each file in turn
	for (var i = 0; i < fileList.length; i++) {
	    // Only want to open non-hidden files (and no folders)
		if ((fileList[i] instanceof File) && (fileList[i].hidden == false)) {
			// Open the file in Photoshop
			var docRef = open(fileList[i]);
			if (docRef == null)
				throw X_BADDOC;

			if (docRef.xmpMetadata != null) {
				// Document has XMP metadata, so process it
				var inFileName = fileList[i].name; // Filename without path
				// Replace the file's current extension (e.g. .jpg) with .xmp
				var outFileName = inFileName.toLowerCase(); // Output file is lower case
				outFileName = outFileName.replace(FILE_TYPE, XMP_TYPE); // Make .xmp
				var outputXMP = new File(inputFolder + "/" + outFileName);
				// Open file for writing. Mac type and creator are ignored on other systems
				var success = outputXMP.open("w", MAC_XMP_TYPE, MAC_XMP_CREATOR);
				if (!success)
					throw X_WERROR;

				// Write out the meta data
				success = outputXMP.writeln(docRef.xmpMetadata.rawData);
				if (!success)
					throw X_WERROR;

				// Close the file
				success = outputXMP.close();
				if (!success)
					throw X_CERROR;
			// Close the Photoshop file
catch (exception) {
	// Show degbug message and then quit
finally {
	// Reset app preferences
	app.displayDialogs = startDisplayDialogs;

Judging by the comments on photography sites, many people have yet to upgrade Adobe Photoshop CS3 to CS4, or Lightroom 1.x to 2.x. Adobe doesn’t update the Camera Raw plug-in for older versions of Photoshop, which is a problem because updates are the only way to get support for new camera models. The same problem exists for Lightroom, where a new version of the program is required.

The Canon 50D isn’t supported in Lightroom 1.4 — only version 2.x. While the 50D is supported in Camera Raw 4.6, which means you can use it with Photoshop CS3, owners of the 5D Mark II are not so lucky: no support in Lightroom 1.4 and no support in Photoshop CS3 either; it’s supported in Camera Raw 5.2 which only works with Photoshop CS4.

To solve this problem, use the latest version of Adobe’s free DNG (Digital NeGative) converter to translate the RAW files from newer cameras into .DNG files. Lightroom 1.4 and Photoshop CS3 can open any DNG file, regardless of the original camera type. The DNG converter can be found here, and there are PC and Mac variants. It is updated at the same time as the Camera Raw plug-in for Photoshop when new camera support is added.

It works in batch mode — you point it at a directory (folder) full of RAW files and it grinds away creating DNGs in another directory. Taking the long view, DNG is probably a better file format for archiving images because it is open, unlike the proprietary camera-makers’ RAW file formats.

A sparkline is a small line graph designed to be used in-line within text to illustrate a time series; the concept was developed by data presentation guru Edward Tufte. Here’s an example:

University of California 403(b) pension fund cumulative return Jan 1990-April 2004 (original data)

Equities 267%
Bonds 154%

The idea is to show, using minimal space, how a value varies over time. One advantage of sparklines’ compactness is that several can be used together to allow at-a-glance comparison between a set of time series. At Tufte’s web site there is a longer description of sparklines, with further examples, from a sample chapter of Tufte’s book, Beautiful Evidence. Sparklines are tangentially related to photography – they are used alongside images as a graphical design element in qualitative and quantitative analysis.

Sparklines can be hard to produce. Most graphing packages are designed to produce large graphs or charts, and it can be very hard to generate the wide-but-thin lines for incorporation in documents. This was the motivation for writing a Photoshop script that would automate the production of sparklines. It works by reading a data series from a text file and plotting a sparkline image as a Photoshop path, and then stroking it with the pencil tool. This produces a bitmap image which can then be cut-and-pasted into the target document. The user retains control of the color and line style of the sparkline by setting the Photoshop foreground color and pencil tool settings before running the script.

Mac support and PS CS2 testing

Some Mac users had reported problems with the Sparkline script not being able to open text data files. Thanks to the help of two kindly Mac contributors, I found and fixed the problem. In addition, the script has been tested on Photoshop CS2. All the changes are incorporated in Version 2 of the script below.

Installing the sparkline script

The code of the sparkline script for Adobe Photoshop CS/CS2/CS3 is included below. While it will run on Mac or PC Photoshop, it does not work on any earlier versions. You can also right click (Mac: Option click) here to download the script. Select “Save as…” from the menu that pops up, and save it somewhere where you can find it on your computer.

The script works on textual data files, where the first line is the name of the quantity being charted, and the remainder of the lines are the data values. To start you off, here’s a sample data file for wind speed. Using Microsoft Excel, it’s easy to create data files in this format: put the legend in cell A1, then the data values in cells A2, A3 and so on, and then do File->Save As… and select “Text file” for the output format.

To install the script, first locate Adobe Photoshop’s main directory on your computer. On my (Windows) computer, it’s in C:Program FilesAdobePhotoshop CS

On the PC, save the script as Sparklinev2.js in the directory <Photoshop dir>PresetsScripts

On the Mac, save the script as Sparklinev2.js in the directory <Photoshop dir>/Presets/Scripts

Start Photoshop (or re-start it, if it was already running). You should now see the Sparkline script on the File->Scripts menu:

Using the script

First of all, select the foreground color and Pencil tool settings that you want to use for the Sparkline. To select a foreground color, double click on the foreground color swatch in the palette menu. To select the pencil tool, right-click (Mac: option-click) on the palette menu as shown:

Then, set the pencil defaults to whatever you’d prefer using the tool menu just below the Photoshop menu bar:

Click File->Scripts->Sparkline (as shown in the screen shot above) to start the script. You will be promoted to locate the file containing the sparkline data:

Click “Open”; the script will open the file and then prompt you for the height of the sparkline, in pixels. The default height is 50 pixels, which is 50 points (0.7″) high on a typical 72dpi computer screen, and 12 points high when printed on paper at 300dpi (you can change the default height by editing the script).

The script will then ask if you want to automatically scale the sparkline to the document height. If you select Yes, then the script uses the minimum and maximum values present in the data file to scale the Y axis such that the minimum value is plotted at the bottom of the document, and the maximum value is plotted at the top, like this (a border has been added to make it easier to see the effect):

If you select No, then the script will prompt you for the Y intercept (the data value that will be plotted at the bottom of the document) and the maximum Y value (which will be plotted at the top of the document). For example, using a Y intercept of 0 and a max Y value of 50, the same data would be plotted as follows (again, border added for clarity):

Finally, the script asks for the X axis pixel spacing between points. The default setting of 1 plots each point of the sparkline immediately adjacent (one pixel away) from the previous point. To make the sparkline shorter, use a value less than 1. To make it longer, use a value greater than one. For example:

X axis pixel spacing of 0.3:

X axis pixel spacing of 0.5:

Advanced topics: Use of time travel

Because the script creates a regular Photoshop document complete with history, you can use the Photoshop history palette to “go back in time” and change the way that the path is stroked. For example, to use a Brush stroke rather than a Pencil stroke, you’d go back in the document history to the point where the path has been saved, but before it has been stroked. Then stroke it with the Brush, rather than the Pencil.

First of all, open both the History and Paths palettes. Then, use the History palette to go back to the document state before the stroke occurred:

Then, right click (Mac: option-click) on the Sparkline path in the channels palette. Select “Stroke path…” from the pop-up menu.

The following dialog will appear, and you can elect to stroke the path using the Brush, or indeed any of the other Photoshop tools:

Script source code