Sunday, 13 November 2011

Network Configuration in Solaris 11 with NWAM Profiles

Oracle has just released the Solaris 11 operating system, the new production ready Solaris major release. It's an "interesting" release since it's the first Solaris major release under the Oracle egemony and it inherits all of the technologies many of us have been using, in the last few years, in the Solaris Express and OpenSolaris releases that Sun Microsystems used to provide.

This blog post is the first part of a series of quick wrap ups for the impatient to quickly start and configure their new Solaris 11 servers. My advice is always the same: read the manual.

Network Configuration Changes in Solaris 11

Network configuration in Solaris 11 is pretty different than it was in earlier Solaris releases (including Solaris Express) and many administrators may be taken by surprise. Some of these changes were introduced in the corresponding OpenSolaris projects, such as Crossbows, and may be known by many of us. To sum things up, the major differences are the following:
  • Network configuration is now managed by a profile.
  • The dladm command now centralizes the configuration of layer 2 datalinks: many tasks performed by the ifconfig command on previous Solaris releases are now to be performed using the dladm command.
  • Datalink names aren't bound to their hardware driver name any longer.
  • IP interfaces on layer 3 are configured by using the ipadm command: the venerable ifconfig command has been deprecated in the Solaris 11 release.
  • IP network multi pathing (IPMP) groups are now implemented as IP interface and as such, configured with the ipadm command.
  • The new ipmpstat command has been introduced to gather statistics about IPMP groups.
  • Network virtualization has been implemented on the network device level.

The Solaris 11 Network Stack

The new Solaris 11 network stack is similar to Solaris 10's. Yet, some improvements have been introduced that administrators are simply going to love.
In the new network stack, the software layer has been decoupled from the hardware layer: this means that:
  • The network configuration of a system (or a zone) is insulated from the hardware it's running upon. 
  • As already stated, datalink names can be customized.
  • Many network abstractions (such as VNICs) are managed in the datalink layer: this means that all of the datalink configurations can be centrally managed with one administrative interface.
On Solaris 11, then, datalinks aren't named from the underlying physical devices and, by default, are named using the netn scheme, where n is a 0-based integer index. This apparently minor modification has a very important consequence: if you modify the underlying hardware, a network configuration may still be valid if the datalink name is left unchanged. This is really handy, for example:
  • If the underlying hardware of a box changes.
  • If you migrate zones across systems.
  • If you write generic configurations for a wide set of boxes.
The mapping between a datalink and the underlying physical device can be inspected with the dladm command:

$ dladm show-phys
LINK  MEDIA     STATE  SPEED  DUPLEX  DEVICE
net0  Ethernet  up     1000   full    e1000g0
net1  Ethernet  up     1000   full    e1000g1

Network Auto-Magic (NWAM)

Long time users of older Solaris Express releases will remember the introduction of the Network Auto-Magic feature into the operating system. NWAM is a feature that automates the basic network configuration of a Solaris box. NWAM in Solaris 11 has been greatly enhanced and it now supports the following concepts:
  • NCP.
  • Location.  
An NCP is a an administrative unit that specifies the configuration of the components of the network setup such as physical links and IP interfaces. An NCP is itself made up of NCUs (Network Configuration Units) representing the configuration of a physical link or interface.

A Location profile is another administrative unit that let the administrator specify:
  • The conditions under which a profile should be activated.
  • The naming service configuration.
  • The domain name.
  • The IP filter rules.
  • The IPSec policy.
At a given time, only one NCP and one Location profile will be active in a Solaris system.

NWAM is handy when a system network configuration is changed often and an administrator, in those cases, can encapsulate the different and required configurations in profiles (NCPs and Location profiles) and activate them when needed.

If you're using the Solaris 11 desktop, you can use the Network Preferences application (which can be found into the System/Administration menu) to quickly build NCPs and Location profiles.

Network Preferences

In the following sections we will use some NWAM administrative commands but we won't dig into this subject any more and let NWAM administration be the topic of another post.

Configuring the Network

Depending on how a newly Solaris 11 installation has been performed, your initial network configuration may differ. If you've installed it from the Live CD, the Automatic NCP and the Automatic Location profile are active. These profiles are pretty simple: they configure every IP interface and the name service using DHCP, leaving any other configuration option (IP filters, IPSec, etc.) disabled.

If you're using Solaris on your PC this configuration may be good for you but chances are you might be installing some server that requires a less trivial network configuration.

Creating an NCP profile
The first thing you're going to do is creating a new NCP:

$ netcfg create ncp datacenter

The datacenter NCP will be the container of our configuration and we will add the NCU that we need for every link and IP interface we're going to configure.

# netcfg
netcfg> select ncp datacenter
netcfg:ncp:datacenter> create ncu phys net0
Created ncu 'net0'.  Walking properties ...
activation-mode (manual) [manual|prioritized]> 
link-mac-addr> 
link-autopush> 
link-mtu> 
netcfg:ncp:datacenter:ncu:net0> end
Committed changes
netcfg:ncp:datacenter> create ncu ip net0
Created ncu 'net0'.  Walking properties ...
ip-version (ipv4,ipv6) [ipv4|ipv6]> ipv4
ipv4-addrsrc (dhcp) [dhcp|static]> static
ipv4-addr> 192.168.1.53
ipv4-default-route> 192.168.1.1
netcfg:ncp:datacenter:ncu:net0> end
Committed changes
netcfg:ncp:datacenter> exit

With the netcfg command we created an NCP with the following characteristics:

  • It has an NCU for a physical interface (net0). This NCU has been configured with default values for all of its properties (such as MAC address or MTU).
  • It has an NCU for an IP interface (net0). This NCU has been configured with a static IPv4 address and a default router.
If you activate this profile, your system will reconfigure the network according to the settings of this NCP:

# netadm enable -p ncp datacenter
Enabling ncp 'datacenter'

If we now check the IP interfaces we can see how they've been configured according to the above-mentioned NCUs: the net1 IP interface is up while the net0 interface has disappeared.

# ipadm show-if
IFNAME  CLASS     STATE  ACTIVE OVER
lo0     loopback  ok     yes    --
net1    ip        ok     yes    --

If we check the IP addresses currently used, the ipadm command confirms that only net1 has been assigned an address which is the static address we configured in the NCU. Again, net0 has disappeared.

# ipadm show-addr
ADDROBJ  TYPE    STATE  ADDR
lo0/v4   static  ok     127.0.0.1/8
net1/_a  static  ok     192.168.1.53/24
lo0/v6   static  ok     ::1/128

If we know check the state of the datalinks, we can see that net0 is in the unknown state while net1 is up.

# dladm show-phys
LINK  MEDIA     STATE    SPEED  DUPLEX  DEVICE
net0  Ethernet  unknown  1000   full    e1000g0
net1  Ethernet  up       1000   full    e1000g1

If we wanted to add both the net0 datalink and IP interface into the profile, we could simply modify it and create the corresponding NCUs.

If we now try to resolve some name, however, we discover that it's not going to work. If you remember, we're still using the Automatic location profile which configure the name resolver using DHCP. In this case, however, DHCP isn't being used so that the resolver is not going to resolve any name.

What we need now, is a corresponding location profile.

Creating a Location Profile
To configure the resolver settings, we can now create a new location profile, using once more the netcfg command:

netcfg> create loc datacenter
Created loc 'datacenter'.  Walking properties ...
activation-mode (manual) [manual|conditional-any|conditional-all]> 
nameservices (dns) [dns|files|nis|ldap]> 
nameservices-config-file ("/etc/nsswitch.dns")> 
dns-nameservice-configsrc (dhcp) [manual|dhcp]> manual
dns-nameservice-domain> 
dns-nameservice-servers> 192.168.1.1
dns-nameservice-search> yourdomain.com
dns-nameservice-sortlist> 
dns-nameservice-options> 
nfsv4-domain> 
ipfilter-config-file> 
ipfilter-v6-config-file> 
ipnat-config-file> 
ippool-config-file> 
ike-config-file> 
ipsecpolicy-config-file> 
netcfg:loc:datacenter> 
netcfg:loc:datacenter> end
Committed changes
netcfg> end

As soon as we enable the newly created location profile, the resolver is going to use the configured settings and it's just going to work:

$ netadm enable -p loc datacenter
Enabling loc 'datacenter'

$ nslookup www.oracle.com
Server: 192.168.1.1
Address: 192.168.1.1#53

Non-authoritative answer:
www.oracle.com canonical name = www.oracle.com.edgekey.net.
www.oracle.com.edgekey.net canonical name = e4606.b.akamaiedge.net.
Name: e4606.b.akamaiedge.net
Address: 2.20.190.174

Conclusion

As you can see, configuring the basic network settings in a Solaris 11 system is clean and easy. The new administrative interface lets you easily define, store and activate on-demand multiple network configuration for your system without the need of writing and maintaing multiple copies of the old style Solaris network configuration files.

Friday, 11 November 2011

Orton Imagery in Adobe Photoshop

The Orton imagery (a.k.a. Orton effect), named after the photographer Michael Orton, is a technique whose goal is achieving regions of high details and regions of low details in the same image.
The original technique was developed making sandwiches of slide films of the same scene taken with different levels of overexposures and different focussed areas. However, one could also choose to blend completely different slides to achieve more dramatic and artistic effects.

The Orton effect can be easily replicated in the domain of digital photography and, depending on the shooting conditions, even without bracketing exposures or voluntarily defocusing some shots. If you're shooting RAW, it's really easy to modify the exposure of a shot without loosing information, at least for relatively small adjustments: it all depends on the specific camera and RAW file format.

I agree that it's always better if you try to get things right on camera, but sometimes you simply don't known the effects you're going to use in post production. However, since what we need is usually just a maximum +2 f-stop overexposure, there's really no issue doing it during your post-production workflow.

The Basics

As we stated in the introduction, the Orton effect originated with slide films:
  • Two shots differently overexposed were taken.
  • One of them was taken out of focus.
  • The two positive slides were "sandwiched" one above the other.
Since one of the two shots has to be taken out of focus, perfect alignment isn't an issue so don't worry if you're not shooting with a tripod when you realize you're going to take an Orton-candidate shot.

In the digital domain, you aren't going to physically slide any slide and you're going to blend a couple of layers instead. To simulate the effect of two positive layers one above the others, we're going to use the Multiply blending mode:

  • Multiply darkens the lower layer based on the darkness of the upper layer.
This is consistent with what happens to a slide sandwich:
  • Being positive, the white is transparent, and the superposition of two transparent slides filters no light (if we ignore the effect of the slide plastic material itself).
  • Any non transparent area will filter (darken) the light that passes through hence two overlapped slides will filter the light twice.

Overexposing the Image

Since the overlapping layers will be multiplied, they should be overexposed so as to preserve the desired exposure of the resulting image. There's no formula to determine how much the two layers must be overexposed, just trial and error and a bit of experience.

As a rule of thumb, a total overexposure of 2 or 3 f-stops will usually give good results. However, care must be taken:

  • To avoid to clip some channel up: this may be an issue with images with large highlight areas that will be clipped with little overexposure.
  • To avoid to clip some channel down: this may be an issue with images with large shadow areas that are going to clip the black point when multiplied.
Usually, my golden rule is:
  • The darker an image, the more I overexpose it, paying attention not to clip the white.
Once a channel is clipped, information is lost. Even if you multiply two layers where the white is clipped, the result in the clipped pixels will still be white.

Defocusing the Image

This is the most critical step, indeed. If you defocus the image on camera, you're taking advantage of your lens bokeh. This is something difficult to replicate in post production, and few software have some better blurring algorithms rather than motion blur or gaussian blur.

I usually rely on the gaussian blur filter to defocus an image in post production but, if you're a Photoshop user, you could use the more advanced lens blur filter.

How To Overexpose

As I said, you've got two choices:
  • Either you overexpose on camera.
  • Or you overexpose on post production.
If you're choosing the quickest path, I seriously recommend you do it only if you shoot RAW. Shooting RAW has got the advantage of recording more dynamic range than what it's actually shown in the picture. When you overexpose a RAW image you're going to get better results, especially in the shadows area, where the additional information will bring up more details in the darkest tones.

For the sake of this example, we're going to overexpose a RAW image in post production using Adobe Lightroom. As you can see from the histogram, the blue and red channels are going to be clipped as soon as we overexpose the image.

Histogram of the Original Image

In this case, I decided to apply a minimum overexposure of 1 f-stop and postpone the final decision after checking the final result. The original image and the resulting overexposed image by 1 f-stop are the following:

Original Image

Image Overexposed by 1 f-stop

Much of the area of the petals may seem burned out but, fortunately, there's still sufficient information for the multiply blending mode to bring down in the final result, as you can see from the following image:



Orton Effect in Photoshop

Now that the two overexposed images are ready, let's switch to Photoshop to compose the final Orton image. This process is pretty simple and Photoshop is not required: you can use Photoshop Elements or The Gimp, just to cite a few. In this case, we're going to use Photoshop Elements.

The first step is trivial: opening the two images.

The Two Images Opened in Photoshop Elements

The second step is pasting the second photo as a new layer in the first photo. The quickest way to do it is:

  • Use the Select/All menu option.
  • Choose the Move tool from the palette (or press the V key).
  • Drag the selected image into the other. In Photoshop Elements you are required to drag it over the title tab, first, to have Photoshop switch between the two documents.
  • Photoshop will automatically create the second layer for you.
  • Use the move tool to align the two images.
In the layer palette, you should see the newly created layer.

Layer Palette - Resulting Layers


Now, change the blending mode of the upper layer to Multiply.

Layer Palette - Second Layer Blended with Multiply

The result so far should be a darker, more contrasted and more saturated image such as the following:

Resulting Image After Applying the Multiply Blending Mode

The last step is blurring the upper image. In this case we're going to use the gaussian blur filter but, if you've got some other blurring filter, you can try and explore new possibilities.

Also, the "quantity of blur" (radius, in the case of the gaussian blur filter) will depend on your image. For a good Orton effect you need to blur an image so that details are lost but shapes preserved. With a flower of such size in a 16 Megapixels image, I applied the gaussian blur filter with a radius of 20 pixels to achieve the following result (only the blurred layer is shown):

Gaussian Blur Filtered Layer with Radius = 20 px

The Result

The final result is this:

Final Result - Orton Effect

As you can see, the Orton effect is faithfully reproduced.

It's important to realize that every image is different, and so is the effect that you've got in your mind. The parameters you're going to use can be tweaked in order to achieve the desired effect:

  • If you want a softer (or sharper) image, just raise (or lower) the gaussian blur radius.
  • If the image is too dark, raise the overexposure of one or both of the layers.
  • If the image is too light, lower the overexposure of one or both of the layers.

A Tip For Who's Not Shooting RAW

If you want to apply this effect to a non-RAW image, you need to overexpose it using other means. The only thing you can refrain from trying is using the Brightness adjustment. It's just not designed for that and the results you're going to achieve will be awful, at best.

A good technique to simulate an overexposure in Photoshop (or The Gimp) is using the Screen blending mode. The screen blending mode can be thought as the opposite of the Multiply blending mode:
  • It brightens the lower layer proportionally to the brightness of the upper layer.
Blending an image with itself with the Screen blending mode is a good way to simulate an overexposure.



Monday, 7 November 2011

The Grey Blog Has Switched to Dynamic Views

After some weeks of testing, I've finally decided to switch to Dynamic Views. Dynamic Views, in case you don't know, are a new set of Blogger templates. They aren't just templates, however, since they introduce a major change in both the authoring experience of us, the Blogger authors, and of you, the readers. Here's an introductory article about Dynamic Views from the Official Google Blog.

I've chosen the Magazine theme as the default Dynamic Views theme for this blog, but you can change it and choose any of the available ones using the toolbar:

Changing the template was a difficult decision for me. First of all, I'm not a web guy. Absolutely. I just picked a template I liked, used it and customized it a little bit over time. When I first saw Dynamic Views, they really surprised me. They were "clean" and much easier to read than the average Blogger template. Above all, I realized they were going to need very few, if not any, modifications: I just had to pick one and apply it.

You, the reader, can enjoy a new and very readable interface with infinite scrolling. And if you don't like the Magazine theme, just change it. I, the author, am not going to fiddle with the template any longer.

Except for one "glitch": HTML headers, especially <h4/>, <h5/> and <h6/> headers, historically used to mark the titles of a blog post, aren't styled in the default templates, with great detriment of the readability of the old posts. I was forced to add attach new CSS to the template to have, at least, <h4/>, <h5/> and <h6/> headers printed in bold face. Unfortunately, I used both <h2/> and <h3/> headers in older posts and they will show up incorrectly: Blogger styles those headers in its own templates, and I'm not going to fix that in my custom CSS (hey, I told you I'm not a web guy).

I hope like it!

Sunday, 6 November 2011

Clarity Adjustment (Local Contrast) in Adobe Photoshop

In a post of my Lightroom tutorial series, we've seen how the Clarity tool lets you apply both positive and negative local contrast adjustments. The Clarity tool comes from Adobe Camera RAW, used by Lightroom under the hood, and it provides a really quick and easy way to perform a task that, otherwise, would require much more time to achieve.

Adobe Photoshop, for example, does not provide such a simple way to modify a picture local contrast and by its own nature, this kind of adjustment cannot be achieved with tools that modify the overall image, no matter how complex they are: you are not going to raise only the local contrast using the Contrast, the Levels or the Curves adjustment.

Even if you're a Lightroom user, there are times when you're going to use Photoshop (or similar programs) in your workflow: I deem necessary to know how you can achieve the same result when you cannot rely either on Camera RAW or Lightroom. The good news is that you can achieve the result both in Photoshop and in Photoshop Elements, the stripped down version of Photoshop aimed at beginners and amateurs.

The Unsharp Mask

The Unsharp mask is a tool that's best known to Photoshop users to sharpen an image. It's funny how names can be so misleading at times, isn't it? If you're interested about the history of the technique this name comes from, you can have a look at the Wikipedia article about it.

However, as far as we're concerned, the important thing is the following: the unsharp mask can be used to raise the local contrast of an image in a very simple way.

You can see the Unsharp mask window in Photoshop Express in the following picture:
Photoshop Elements - Unshard Mask Window

Unsharp mask adjustments are applied according on three parameters:
  • Amount.
  • Radius.
  • Threshold.
Usually, when you use the Unsharp mask tool to sharpen an image you select a relatively small radius and a large amount. On the other hand, if you use a relatively large radius and a small amount, the effect will be a local contrast enhancement. If you read the Wikipedia article about this technique, the radius is used to tell how much the image should be blurred during the process of detecting transitions.

In the following example, you can see the effect on the same image we used as an example of the Clarity adjustment in the aforementioned post:

Original Image
Unsharp Mask - Amount 20%, Radius 50, Threshold 0

What About Negative Clarity (a.k.a., Reducing Local Contrast)?

The Unsharp mask is an easy way to enhance the local contrast of an image: so far so good. But if you've used the Lightroom Clarity tool, you're probably missing negative clarity adjustments as well! There's no way to reduce the local contrast using the technique seen so far and you must rely on other tools.

To understand how you can achieve negative clarity, we will first look at how positive clarity can be achieved manually (reproducing the steps that are performed by the Unsharp mask tool).

The first steps is detecting transitions. In film photography, the process was pretty complex. Photoshop makes it easy: that's what the High pass filter is meant for. If we use a radius of 1.5 pixels, this is the result:

High Pass Filter - Radius 1.5 pixels

The result is:
  • Neutral grey pixels where no transitions were detected.
  • Colored pixels where transitions were detected.
This new layer will be superimposed to the original using the Overlay blending mode. The neutral grey pixels won't affect the underlaying pixels while pixels marking transactions will enhance the local contrast. This happens because the Overlay blending mode multiplies (darkens) dark areas and screens (lightens) light ones. The final result is the following:

High Pass Filtered Layer Overlaid on the Original Image

There's no doubt that using the Unsharp mask tool is much quicker when we need to enhance local contrast. What about negative clarity, then? Simply invert the layer generated by the high pass filter:

High Pass Filtered Layer Inverted and Overlaid on the Original Image

Pretty much the same effect you'd get in Lightroom using negative clarity, only a bit more difficult.





Adobe Photoshop Lightroom Tutorial - Part XII - Presence Controls

Part I - Introduction
Part II - Lightroom Workflow
Part III - Organizing the Library
Part IV - Keywording and Metadata
Part V - Using Filters
Part VI - Importing Your Images
Part VII - Basic Editing Tools
Part VIII - Developing Your Images, The Basics
Part IX - Reading and Interpreting the Histogram - Basic Adjustments
Part X - White Balance
Part XI - The Tonal Scale
Part XII - Presence Controls
Part XIII - Coming Soon!

Presence Controls

Last but not least, the Basic panel offers a group of control labelled Presence and made up of:
  • Clarity.
  • Vibrance.
  • Saturation.
For the sake of simplicity, let's start from the last one: saturation.

Saturation

To make a long story short, saturation controls the intensity of a color. The Saturation slider in Lightroom lets you uniformly modify the saturation of the colors in an image in a [-100, 100] range:
  • A -100 saturation adjustment corresponds to no saturation at all and the result will be a monochrome image.
  • A 100 saturation adjustment corresponds to doubling the saturation of the colors.
Beware that when you increase the saturation of an image, colors channels may be clipped and as a result color shifting may occur.

I don't use the saturation tool very often, partly because I'm not so fond of too "punchy" images, and partly because of its own non-selective nature: more often than not, I only need a more selective kind of saturation enhancement:
  • I need to boost the saturation of a selected set of colors.
  • I don't want skin tones to saturate and have that orange cast.
Truth be told: I almost only use the saturation slider to completely remove the saturation of an image to produce a monochrome one. Why not simply tell Lightroom to convert the image to black and white, then? Well, just because Lightroom, by default, uses a black and white color mix that's not uniform across the spectrum (as we'll see in a future post). Sometimes it's a good starting point, sometimes it's not. Only trying with a specific image can tell.

Lightroom, as we're going to see in the following seections, provides good solutions to many of the aforementioned problems, and that's the reason why I don't use the saturation adjustment so much.

Vibrance

The Vibrance adjustment is a selective and non uniform saturation adjustment with the following characteristics:
  • It tries to avoid channel clipping.
  • When raising the saturation, it has more effect on lesser saturated colors than on more saturated ones.
  • It tries to preserve skin tones.
As a quick example, have a look at the following series of image:

Original Image
Saturation -75
Saturation +75
You can see as Saturation raises and lowers uniformly the saturation of the colors in the image.

However, this is the effect of the same adjustment using the Vibrance tool:

Vibrance -75
Vibrance +75
The Vibrance tool reduces and raises the saturation of the least saturated colors, in this case the background greens, leaving the more saturated colors, in this case the yellow petals and its orange shades toward the center, almost unmodified. In this specific case, you could also use Lightroom to selectively raise the saturation of the green channel (as we'll see in a future post).

However, the Vibrance tools is a handy tool that can help you apply saturation adjustment in a really quick way, especially in portrait photography when things can get really tricky when trying to preserve the skin tones of our models. Had we applied such a saturation adjustment in a portrait, orange shades would probably had popped up in our subject's skin pretty much as they popped up in the petals of this flower. In those cases, only Photoshop would be your friend: you'd use layers and layer masks to preserve the tones in selected image regions. Fortunately, Lightroom gets in the way and provides this quick solution to such a common problem.

Clarity (And Local Contrast)


The Clarity adjustment lets you add depth to an image by modifying local contrast. But what's local contrast, first of all? Here's a really quick introduction about this problem.

The physiology of the human eye is such that, in certain circumstances, a photo cannot be a faithful representation of what we perceive. This is especially true when dynamic range is taken into account. You have surely noticed how a well your eyes can see a scene with a high dynamic range (such as a landscape with both strong lights and deep shadows) and how bad the same scene look when you shoot it, no matter the effort you put into it. When we move our eyes around, they'll quickly adapt to the light conditions of the part of the scene we're focusing on, although you may have the impression of perceiving the entire scene as if no adaptation has occurred. On the other hand, when you take a shot you have to choose an exposure, and if the dynamic range of the scene you're taking is too high, you will simply miss the shot: either you burn the highlight or you lose details in the shadows. If you've heard about HDR (High Dynamic Range) imaging, you'll probably realize what the central idea of that technique is: you take multiple shots of the same imaging bracketing the exposure and blend them together in a single image, preserving the intensities you need across the dynamic range of the picture. This way, you artificially build a visual representation of what our eyes perceive when they move, and compensate, across regions of the image with big luminance differences.

You may think of local contrast as a technique to achieve the opposite goal: you selectively raise the contrast of light-shadow transitions to give more dynamic range to your image. However, instead of raising the overall contrast of the image (where both white and black points are moved and clippings may occur), the adjustment in only performed in smaller regions of the picture, leaving the overall black-white difference unmodified.

Lightroom lets you adjust the local contrast by both positive and negative values, in the [-100, 100] range.  Let's see some examples of how Clarity works.

Original
In this picture, the majority of pixels find themselves on the opposite sides of the range: the background is nearly black and the flower is white. Neither white nor blacks are clipped. Since the maximum luminance difference in the flower's pixels is less than 1 f-stop away, you may want to apply some adjustment to give the flower some more depth. Raising the overall contrast, as we've seen in a previous part, will only make things worse:

Contrast +100

Raising the overall contrast is going to raise the differences between black and white, but doing so means compressing whites even further, and the result will be a flower even flatter than before. You may be tempted to apply the opposite adjustment and bring overall contrast down:

Contrast -50
In fact, reducing the overall contrast expands the histogram in the recovery and in the rightest part of the exposure zone pushing them towards the center of the histogram. The flower will indeed gain depth. Unfortunately, the overall contrast reduction is going to expand the blacks and the shadows as well, pushing them towards the center of the histogram. The final result is not probably what we were looking for since the image is now flatter and duller.

Once again, there's no need to leave Lightroom and open Photoshop. The Clarity adjustment is just what we were looking for:

Clarity +50
Increasing the local contrast has raised the depth of both the flower and the leaves, leaving the overall contrast unmodified. The white and the black points do not move and we introduce no clipping at all.

Clarity adjustments are often subtle, and I suggest you zoom out when you apply it. Nevertheless, it's a very handy adjustment which many pictures can benefit from. Look at the following example (to appreciate the difference you may need to open the liked image):

Original Image
Clarity +60
Original Image
Clarity +75

Negative Clarity

The Clarity tool lets you apply negative clarity adjustment. Why would you want to reduce the local contrast of an image? Reducing local contrast has a softening effect that may be result pleasing in some kind of photos. Some portraits and some nature images, for instance, may benefit from a slight reduction of clarity, if you want to achieve a "dreamy" or "soft" mood without spending much time on applying more complex effects such as the Orton effect. In the following example you can see how a negative clarity affects the image of the two purple flowers that we've previously seen:

Clarity -50


If you want to help me keep on writing this blog, buy your Adobe Photoshop licenses at the best price on Amazon using the links below.

Wednesday, 2 November 2011

Vim Celebrates 20 Years - Happy Birthday Vim !

20 years ago this day (November 2), Bram Moolenaar created Vim - an improved version of Vi text editor found in most Unix systems. Since then, Vim has flourished to become the Swiss army knife of text editors. The latest version of Vim is 7.3 which was released a little over a year ago. Vim is truly cross platform and works on Unix, Linux, Mac OS X, and Windows.
Read more »

Sunday, 30 October 2011

Adobe Photoshop Lightroom Tutorial - Part XI - The Tonal Scale

Part I - Introduction
Part II - Lightroom Workflow
Part III - Organizing the Library
Part IV - Keywording and Metadata
Part V - Using Filters
Part VI - Importing Your Images
Part VII - Basic Editing Tools
Part VIII - Developing Your Images, The Basics
Part IX - Reading and Interpreting the Histogram - Basic Adjustments
Part X - White Balance
Part XI - The Tonal Scale
Part XII - Presence Controls
Part XIII - Coming Soon!

Adjusting the Tonal Scale

The Basic panel of the Develop module contains the editing tools to control the tonal scale of the image. Finer tonal scale adjustments can be performed in a variety of ways:

  • Using the basic tonal scale sliders.
  • Using the Tonal Curve tool.
  • Using the histogram.

The effect of using the tonal scale sliders in the Basic panel and the histogram is equivalent: in fact, the histogram just provides an easier (and more "visual" way) of adjusting the tonal sliders. The Tonal Curve tool (or an external program as well) provide a more flexible and powerful way to adjust the tonal scale, but my advice is: always start editing your images fixing the tonal scale using the tonal scale sliders. Only then, perform additional corrections using more advanced tools.

Lightroom provides the following tonal scale sliders:
  • Exposure.
  • Recovery.
  • Fill light.
  • Blacks.
  • Brightness.
  • Contrast.
The first four sliders let you adjust the tonal scale of the image with specific emphasis on a specific region of the histogram. Lightroom visually divides the histogram zones into the regions shown in the following images:





If you want to adjust tones in a specific region, you can click and drag the region to be modified in the histogram: depending on the direction you drag the histogram to, the tonal scale will be adjusted accordingly. Each region corresponds to one of the tonal scale sliders and the corresponding adjustment will mainly target a specific zone, although the entire histogram will be modified as a result (shifting it, expanding it or compressing it).

In the following sections we will describe each tonal scale adjustment.

Exposure

The Exposure adjustment is usually the first adjustment you will use since it fixes the overall exposure of an image, with particular emphasis on the high values of the histogram. The adjustments is measured in f-stops (in the [-4, 4] range) and its effect is very similar to modifying the image exposure by the corresponding number of stops (for example, stopping the aperture up or down).

The effect on the histogram can be seen in the following screenshots:






Raising the Exposure level shifts the histogram to the right while lowering the exposure level shifts the histogram to the left.

The exposure slider is used to correct the overall exposure of the image and ensure that the white is at right level. Sometimes, it's not that easy to spot overexposed pixels in an image: if you click the Alt/Option button while adjusting the Exposure slider, the canvas will turn black and Lightroom will only reveal the pixels a color channel of which is going to be clipped.

If there remain overexposed pixels after correcting the image exposure, you can try to fix them using the Recovery slider.

Recovery

After setting the overall image exposure to the right value, the Recovery slider can be used to correct the tones of overexposed highlights. If the image being corrected is RAW, Lightroom can used additional sensor data and succeed in recovering details of pixel overexposed even more than 1 f-stop.

Adjustments of the Recovery slider are made in the [0, 100] range. The effect of adjusting this slider can be seen in the following pictures:




Raising the Recovery value compresses and shifts left the highest zone of the histogram, thus revealing "lost" details that may be present in the RAW file. On the other hand, if the image being adjusted is not a RAW file, clipped channels will result in information being effectively lost: Lightroom will still compress and shift down the histogram, but it won't be able to recover missing details.

In the following pictures you can see how Recovery helps recover missing details in a picture that was intentionally overexposed by more than 1 f-stop:



You can see as adjusting the Recovery slider to +70 helps recovering details of the overexposed cloud that would have been lost otherwise. The histogram of the pictures before and after the Recovery adjustment are the following:



As you can see, the Recovery adjustment has shifted and compressed the histogram slightly to the left, leaving space to reintroduce the information recorded in the clipped highlights. The following is the histogram of a correctly exposed picture of the same cloud:


As you can see comparing the histogram of the corrected picture above with the histogram of the correctly exposed one, the slope and the profile of the two histogram in the highlights zone is very similar.

Fill Light

The Fill Light adjustment allows you the lighten the shadows of your image without affecting the black point. Adjustments of the Fill Light slider are made in the [0, 100] range, and its effect on the histogram can be seen in the following pictures:




Raising the Fill Light value has the following effect:

  • It slightly compresses and shifts the histogram to the right of the fill light region, without affecting the white point.
  • It slightly expands the histogram to the left of the fill light region, without affecting the black point.

Blacks

The Blacks adjustment is used to set the black point of the image. The adjustment is made in the [0, 100] range. Raising the Blacks value moves the black point to the right, resulting in a higher luminance level to be mapped to black. The effect of this slider mostly affects the darkest tones of the image, leaving midtones and brighter tones almost unaffected.

The effect of the Blacks adjustment can be seen in the following pictures:




Raising the Blacks value has the following effect:

  • It slightly expands and shifts the histogram left, without affecting the white point.
  • Blacks are increasingly clipped, according to the part of the histogram that's shifted beyond the black point.

The Typical Workflow

The typical workflow when adjusting the tonal scale of your image is reflected on the order of the basic tonal scale editing tools in the Lightroom user interface:
  • Overall exposure and the white point is corrected using the Exposure adjustment.
  • White point is optionally fixed using the Recovery adjustment.
  • The brightness of the shadows is corrected using the Fill Lights adjustment.
  • The black point is corrected using the Blacks adjustment.
After correcting the tonal scale of your image with the basic tools, you can fine-tune it using more advanced tool such as the Tone Curve (described in another part of this series).

Difference Between Brightness and Exposure

The Brightness adjustment allows you to correct the overall image brightness, primarily affecting the midtones. Small brightness adjustments may be necessary to correct midtones brightness after correcting the tonal scale of the image with the basic tools. Many Lightroom users wonder what's the difference between Brightness and Exposure. The main difference should already be clear:
  • Exposure affects the image brightness throughout the histogram and moves the white point (where highlights are clipped) shifting channel data beyond the end of the histogram.
  • Brightness mainly affect midtones and affects black and highlights clipping points (black and white points) to a lesser extent, try to not shift channel data beyond the end of the histogram.
To clearly understand the difference between the two adjustments, then, let's look at their effect on the histogram. The effect of Exposure has already been shown in the pictures in the Exposure section; the effect of the Brightness adjustment can be seen in the following pictures:

Brightness - Original (+50)

Brightness - +20

Brightness - +80

Brightness - +100

As you can see, modifying the Brightness level shifts the midtones region of the histogram to the right or to the left. Despite what happens when adjusting the Exposure value, however, Lightroom compresses the histogram towards the clipping points in an attempt to not modify them.

However, huge brightness adjustments end up affecting both the black and the white point: that's why you should only need slight brightness adjustment after tuning the tonal scale with the tonal scale adjustments.

Contrast

The Contrast adjustment allows you to correct the image contrast, mainly affecting the midtones. The effect of adjusting the Contrast value on the histogram can be seen in the following pictures:

Contrast - Original Histogram

Contrast - +100

Contrast - -50

The effect is the following:
  • The right half of the histogram is expanded or compressed to the right, depending on whether contrast is raised or lowered.
  • The left half of the histogram is expanded or compressed to the left, depending on whether contrast is raised or lowered.
As in the case of the Brightness control, it's important to point out that this adjustment affects midtones and can modify both the black and the white points.

Also, if you need to modify the local contrast in another histogram region, Contrast might not be the tool for you: you should have a look to Tone Curves instead.

If you want to help me keep on writing this blog, buy your Adobe Photoshop licenses at the best price on Amazon using the links below.