Tuesday, March 21, 2006

The Thing about Intuition

Intuition seems to be a very important ingredient for any creative process. It is our "natural way" of thinking before it gets systematized into a method where freedom is necessairly reduced.

With LightZone we are trying to build a photographic tool where a certain amount of intuitiveness can be regained in digital image manipulation.

We try to achieve this in two ways:

1) by providing a consistent image manipulation framework in which the photographer is not surprised by the results he may get.

2) by providing tools for image manipulation that are closer to the way human beings seem to perceive and analyze visual information.

By intuitiveness I mean that subtle quality of learning that people seem to have that allows one to forget about the tools he's using and concentrate on the result itself. Our dream is to create a tool for image manipulation that might become "invisible" and allow photographers to manipulate images "directly".

Solid grounding in color science and digital image processing strives to provide consistency of experience.

The brain seems to be able to learn complex patterns out of repeated exposures to consistent stimulation. If a computer program fails to deliver consistent experience than the learning process of "pattern discovery" is hampered and the intuition is never developed.

The other element for developing intuition is the use of appropriate tools, i.e. tools that feel natural for the task to be solved.

We decided to use the Zone System for image analysis and manipulation because most photographers seem to have chosen it historically between other methods and because, aside from being a methodology for obtaining consistent results in the darkroom, it seems to be a powerful framework for thinking about images.

All the discussions about image composition I've found in my career of amateur photographer consist in the breaking down of the image in separate visual elements and the discovery of patterns and juxtapositions between them. It doesn't seem to matter that a certain pattern, or a composition rule, is used rather the mere act of noticing the existence of patterns seems to allow people to eventually create "interesting" images.

The Zone System is formidable framework for image analysis and a place where planning can be performed about how we want to get the image we're "visualizing" out of what the camera is capturing. A certain amount of planning is necessary to decide to place some elements of the image in a specific zone to obtain specific results. Many people do this unconsciously, or "intuitively", some others do it more deliberately. What seems to be required is a place where "visual thinking" can be performed.

The Zone Finder is a very powerful tool for analyzing images, it is based on a segmentation algorithm used in AI for image recognition which manages to decompose an image into "meaningful visual elements", removing irrelevant visual detail (textures) and keeping what matters (shapes).

The Zone Mapper is an intuitive way to present a contrast transformation. With the Zone Mapper the user can apply a transformation to the lightness channel of an image with varying slope, thereby changing contrast in specific portions of the image's contrast range. This seems to be what all photography is about, extracting (or hiding) specific details in an image by means of altering the contrast between the different elements of the image.

Our Region Masks try to gain intuitiveness in the process of local contrast adjustment of an image. They are modeled after the cardboard cutouts that photographers routinely use in the darkroom for burning and dodging, where feathering is performed by moving the mask in front of the enlarger to project a soft shadow on the image.

Saturday, March 18, 2006

Linear Color Space Editing

In my last post I said that gamma adjusted color spaces are bad for image editing.

First off, I am one of those that saw the light reading http://www.aim-dtp.net/index.htm and hasn't recovered yet.

Indeed the entire LightZone project started from the "discovery" that linear color space editing is the thing to do.

I have learned recently that the internet has been a hot place for a while, when the gamma proponents/opponents have been flaming each other for a while.

I don't wish to reheat old flames, but I have to say something all the same.

Gamma encoding has its roots far back in the early days of TV broadcast when the industry had to produce reasonably priced TV sets: to lower costs signal processing in TV receivers should be minimal.

The CRT tube has a non linear transfer function that needs to be compensated to display images properly. To avoid processing the image in the receiver the signal was pre-processed at broadcast time to compensate for the CRT transfer function. This seems to have been the birthplace for the gamma encoding we have in images today:

output_intensity = input_intensity ^ gamma

There actually seems to be a good reason why digital images are gamma encoded. Eight bits per color is not a lot and without gamma encoding for images it would be easy to have banding artifacts in color images.

Gamma encoding seems to be an effective way of performing a perceptually adjusted lossy image compression, using relatively more bits to represent darker parts of the image than for the lighter ones. This is convenient because the eye has a logarithmic sensitivity scale and it sees banding more in the shadows than in the highlights.

With modern computers with lots of RAM and fast CPUs we can afford processing images with 16 bits of precision per channel, which is plenty of resolution for all practical purposes.

At this point there is no excuse anymore to edit images in gamma space, Timo Autiokari has expounded in detail the errors induced by gamma editing, please take a look at his very interesting site:


The problem of linear editing is that tools like Photoshop have been designed with gamma adjusted images in mind. Linear encoded images have most of the "stuff" in the low pixel numeric values and very little in the higher values.

Using curves and histograms in Photoshop with a linear color space is a daunting task. All the information is bunched up in the left side of the histogram making it very hard to evaluate the characteristics of the image. Similarly all the curve work has to be done in a tiny region close to the origin of the curves tool. Very impractical.

In LightZone we use different tools from Curves and Histograms: the Zone Mapper and the Zone Finder. These tools are well adapted to working in a linear color space because they present the information too the user in a logarithmic scale, thereby spreading the intensity information across a large range of values which is using effectively the computer screen real estate and allows to conveniently adjust images on a scale that is natural for the eye.

Friday, March 17, 2006

The Right Scale

In my previous posting I complained about the fact that Photoshop treats an image as a bucket of numbers.

Some people object that the only thing you can process with a computer is indeed numbers and that even if we use a graphical representation for the numbers, they are numbers all the same.

Indeed in the Zone System zones are numbers too, but my point is that there are numbers that are meaningful and numbers that are not, the Zone System numbers provide a piece of information that is relevant to the photographer, while the "Photoshop numbers" instead don't.

This depends on the scale that is used.

Photoshop uses a gamma adjusted representation for the pixel values. This is a very convenient representation when storing images on a 8-bits per channel format, since it provides a "perceptually adjusted" lossy compression scheme, but it is very bad for image processing instead.

It is bad for a number of reasons, first of all gamma adjusted images have a big handicap in the image processing side, images are captured by linear devices, like cameras and scanners, and processing them in a non linear color space produces several unwanted artifacts. This will be the subject of a future posting.

The badness reason I'd like to talk about right now is the way the photographer perceives the scale.

Historically people have been organizing quantities on scales. Big things seem to be distinguished from small and things need to be sorted out in convenient buckets.

Americans insist on using inches, yards, miles, ounces, quarts, gallons, etc. These units are not even directly commensurable with each other and to an european accustomed to the metric system it looks positively weird.

There is a reason for these units though: they set a scale and immediately make it possible for people to tell things apart. Roads are not measured in inches, that's it.

A "right scale" helps the thinking process and provides a concrete support for quick decision making.

The same is with images. Our eyes see things on a logarithmic scale, that is shades of gray seem to vary uniformly (perceptually) when they actually double in lightness intensity. This is similar to how hearing works too, we distinguish sounds in pitch or intensity on a similar logarithmic scale.

In Photography pretty much all quantities are organized in a logarithmic scale: f-stops, exposure times, exposure values, zones. The value of these scales is that they are well adapted to the way we perceive reality and they allow us to develop an intuition about them. With an intuition we can make decisions swiftly and precisely based on "gut feelings". This is how great pictures are always made.

The conclusion I'd like to make is that to adjust images conveniently any numeric value should be presented on a logarithmic scale, such as the Zone Mapper and the Histogram in LightZone.

Wednesday, March 15, 2006

A New Age for Digital Photography

LightZone 1.2 is out!

This is what LightZone 1.0 should have looked like, but nevermind...

So, why do we need LightZone again? What is it? Why do you want something like that?

The thing is that I really don't like is, well, yes, Photoshop. Actually not Photoshop in itself but Photoshop as a tool for Digital Photography. And it is not just Photoshop really, but all the software that we generally use to edit Digital Photos.

What is wrong is that presently all software applications (except for, of course, LightZone :) treat an image as a bucket of numbers, three numbers for every pixel, which are only correlated to the image we see on the screen through a very obscure relationship.

Then what the user is asked for is to change the numbers in some other obscure ways, using Levels or Curves tools, and getting feedback from a Histogram.

Aside from the fact that many Photographers might not be too interested in the mathematical aspects of image processing, even for people well versed in Photoshop mechanics image editing seems to remain cumbersome and unpredictable. A fair amount of trial and error is always involved and every image seems to require a new effort.

My conjecture is that the difficulty lies in the distance between the object being manipulated and the resulting image on the screen. The distance is too large and the brain doesn't bridge the gap.

The photographer looses a very important tool: the capacity of pre-visualizing the changes to the image at every step. Maybe the photographer knows fairly well what he or she wants to get out of an image, but how do you get there from the initial image, what are the steps to follow? I think that Photoshop (and all other imaging software of the kind) makes the task of the photographer very difficult because it is very hard to predict what happens at every step of the corrections. It is a sequence of trial and errors that is usually frustrating and misleading.

What I think is needed is something that allows a more direct manipulation of the image, something analog to what the brain already uses to represent the image.

I think that to modify an image it takes another image.

Photography is some 150 years old now, people have been working with images in the darkroom for a long time and the tool that photographers seem to have universally choosen is some incarnation of the Zone System.

The Zone System, as popularized by Ansel Adams and others in the 40's, divides an image in various zones of different luminosity and provides methods for altering the relationship between them.

Zones can be translated up and down on the brightness scale and ranges of zones can be compressed or expanded.

The Zone System provides to the photographer a great degree of precision, allowing to exactly calculate how the different elements of the image have to be transformed, allowing for great predictability in the results obtained in the darkroom.

Many think that predictability as the reason why photographers use the Zone System. I don't agree.

I believe that the Zone System is actually a way of thinking about images, a framework where the relationship between the graphical elements of an image can be analyzed and thought about even before thinking about what to change.

The reason why this framework is successful is that it can be interiorized by the photographer and it allows the mind to play what if scenarios with the image, the changes can be pre-visualized before being performed.

Good photographers can do the visualization work at the moment they capture the image itself, they choose the exposure, make trade tradeoffs with what the camera and the film can capture in view of what they want to obtain out of the picture they're exposing. Many people do this consciously, others in a more instinctive fashion, but all good photographers do it.

With LightZone I wanted to build a software implementation of the Zone System, a tool that would allow a direct manipulation of an image in terms of zones and light values and thus re-enable the visualization capacity of the human eye and brain.

If you made it this far and you are still interested, then please go download LightZone at http://www.lightcrafts.com and tell me what you think of it.