Tuesday, May 6, 2014

Create black&white image with effect color

Lightzone's color selection makes it easy to create black and white images that have an effect color. This method is usable if you want a single color to pop out. If you want to emphasize a multicolored object you have to use the mask tool in LZ or GIMP-like image processing software. Here is my step-by-step guide.

Below is the original image after basic enhancements, which I want turn it B&W, but leave the old lady's walking aid red. In this image you could safely pick the color directly. Risk in that method is that if there is same tone in other parts of the image, those would be also left colored. The method I describe is slightly more complicated, but it will guarantee, that there are no unwanted colored spots left.


Select the B&W tool and draw a mask around the object you want leave colored. You don't need to follow the object's outline, it's enough that there is not same tone within the area. In the B&W tool settings tick the "Invert mask".


The next step is turn also the area around the walking aid B&W. Select a second B&W tool and in the color settings select the eye-dropper. Click on the walking aid and tick "Invert" – and there you are!


I like this image more, when it's pure B&W, but I selected this to show the power of LZ on an object that has a very complex shape. It would a huge task to draw a mask that follows the outline of the walking aid.

If you use the same method with other tools than B&W they may not sum as nicely as B&W. My suggestion would be to remove the transition zone in the mask and link the mask to the tool's second appearance. Then you would be applying the same transition only once to each pixel.

Tuesday, March 25, 2014

Modifying LightZone sidecar files

LightZone sidecar file

My this blog is about the internals of the LightZone sidecar file and what you can do with it. As I mentioned in one of my posts in the LightZone forum that I'll create a small utility that can extract the LightZone "receipe" from the _lzn.jpg file. The only obstacle was that I needed to learn Python first.

I found from an old unofficial LightZone blog an lzntool utility made by Alex Sidorenko. The software was created for situations where you move or rename the original raw image. Quote from the original web site: "As these two files [_lzn.jpg and RAW] are interrelated, moving/renaming them can create problems. Usually moving both files to another directory is OK (we will discuss this later). But if you change the name of your raw file, LZ will see it as unrelated to LZN-file. Just renaming the associated lzn-file will not help - you need to change the contents of LZN-file as well." So if you want to move or rename the RAW file you need do the changes in the file system and then modify the contents of the LZN file to reflect the changes.

The problem is that the LZN files are binary and the LightZone block is preceded with binary length so editing the files would require a binary editor and manual calculations for the block length. For that reason Alex created his Python program to solve this problem.  Alex explains on the web page well how to identify the LigthZone block from the JPEG file.

I took his program, converted it from Python 2 to Python 3 and added an option to extract the LZN block to a new .lzn file without the JPEG preview image. This file can then be edited with Notepad or other text editors and used in LZ. This is a command line utility and you need to have Python 3 installed.

>Python lzntool020.py --help
usage: lzntool020.py [-h] [-l] [--setrawpath SETRAWPATH]
                     [--setrawrelpath SETRAWRELPATH] [--setname SETNAME] [-t]
                     [-v] [--version]
                     fname

positional arguments:
  fname                 _lzn.jpg file

optional arguments:
  -h, --help            show this help message and exit
  -l, --list            list path names as used by LZ and exit. Adding '-v'
                        will print the whole LZ-section
  --setrawpath SETRAWPATH
                        Modify RAW file pathname in LZN-file. This does not
                        rename the real RAW-file
  --setrawrelpath SETRAWRELPATH
                        Modify RAW file relpathname in LZN-file. This does not
                        rename the real RAW-file
  --setname SETNAME     Modify both path and relPath by changing name only, do
                        not modify the directory parts
  -t, --text            Extract the LZN info from the file and store it as
                        .lzn file
  -v                    verbose output
  --version             Display version information and exit.

There are some issues you need to be aware
  • if you specify --setname and --setrawpath and/or --setrawrelpath the --setname will be overwritten by the two other parameters
  • using the .lzn file in LightZone has some issues (see below)

LightZone opens the .lzn file without any problems. The problem I haven't been able to solve is how to make LZ to save the changes as .lzn. Currently LZ saves the changes with the preview image (like _lzn.jpg). This file generates an error in LZ when reopened unless the .lzn is renamed to _lzn.jpg, then LZ works fine. The error message is "Error reading the file Couldn't read XML:com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence."

I looked at the source code in github and guessed that setting <Save type="LZN"> would work. But when I try to open the file in LZ I get an error "Malformed LightZone file No valid SaveOptions data". For time being I have left the  <Save type="JPEG (sidecar)"> with the side effects.

Has the support for saving as .lzn been removed in some older version even the backwards compatibility to read the .lzn files has been kept? I hope someone having better understanding of the insides of LZ could help me.

Download

Monday, March 17, 2014

Artistic with LightZone

I played during the last weekend with LZ and tried to find ways how to create little different look to my photo.

My daughter was going to a masquerade ball, dressed in black dress, red shoes and red masque with yellow feathers. Here is the original image with the in-camera settings.

I had an external flash placed quite near on the right and a white door facing my daughter. The setting gave the strong shadow on the white wall and still the reflecting light illuminated her face.

In LZ I set
  • the WB to 6000K and decreased exposure by 1/3
  • applied standard Canon 600D raw tone curve
  • added vibrance (+30) to mids & highlights
  • softened the skin with standard style "Skin Glow" and changed the skin color to match the skin in the image
  • added color to masks and shoes with additional Saturation +20 and Vibrance +10 (2 × Hue/Saturation tool: applying to red and yellow)


This was now quite good standard portrait. But I wanted to do some more. I wanted to create an image that looked like made bt "Andy Warhol". I used Gaussian Blur on mids & highlights and highly over-did it. I set the radius to 150 to achieve the result below.


I'm happy with the final result and also that I could achieve all in LZ. The tool stack helped to experiment and revert to previous version easily and I didn't have to work with multiple tools and copies.

If you want the get really psychedelic results, use large radius and set the blend mode to difference.

Tuesday, March 4, 2014

LightZone default Tone Curve for Canon 600D

Finally I have had some time to do some more experimenting. Some posts in the LZ forum hinted that there might be some issues with the Raw Tone Curve for Canon 600D. I unlocked the Tone Curve and just experimented changing the default mode "RGB" to "Luminosity". The difference is huge and the luminosity setting produces much more natural tones. The RGB image is over saturated.
RGB Tone Curve (default) Luminosity Tone Curve
As a reference, here is again the same image in DPP. The image in DPP is warmer (more yellow), but otherwise the overall saturation of reds and yellows are quite much alike with the luminosity setting and in DPP.
Canon's DPP

Wednesday, February 19, 2014

Histograms

Based on the discussions in the LightZone forum and my own experiments I found that histogram ≠ histogram.

I created in DPP a slightly processed JPG of the same image I used in my previous post. I opened then the JPG image both in DPP and LZ and the RGB histograms were different even the images looked the same. I had earlier assumed that the differences in the histograms were caused by different processing of the raw image, but that is not true. The histograms don't visualize the same thing!

Canon Digital Photo Professional LightZone
I found a piece of software ImageJ that has an option to copy-paste the channel histogram data into Excel. I then generated a simple channel intensity vs. pixel count chart and that corresponds quite well with the DPP histogram. It looks like the scaling of the y-axis in DPP is not linear, e.g. the first peak in blues is about a third of the highest peak in DPP but in Excel it's about two thirds (200k vs 320k). I tried to change the x-axis to logarithmic so that I could have produced the histogram in LZ, but the result wasn't the same. I guess LZ shows some kind of luminosity vs. channel intensity histogram as the x-axis would indicate.

Linear and logarithmic histograms generated in Excel

Monday, February 17, 2014

Experimenting with different digital darkroom software

I have used a long time Canon's Digital Photo Professional (DPP) for processing my raw images. Sometime ago I found RawTherapee (RT) and used it a little, but wasn't really fond of it. I found the learning curve too steep. Couple of weeks ago I learned about LightZone (LZ) and it has been more to my taste than RawTherapee. In LightZone I have more control of the process than I do in DPP, but LZ is easier to grasp and achieve what you want to than RT.

Today I was trying to create similar styles as DPP has (mainly landscape and portrait) and I found significant differences how the programs process the raw image and found that my task is not going to be that easy.
Here are the images, no additional processing, just "developing" the raw image. Images are taken with Canon 600D, EF-S 18-55mm f/3.5-5.6 IS II (@ 55mm, f/9.0, 1/800s, ISO 200).

Digital Photo Professional RawTherapee LightZone

Findings

DPP's and RT's RGB curves look quite similar, but the LZ produces totally different curves. The peaks at the shadows have in LZ moved to midtones and the small peaks at high tones are in LZ significantly higher. In fact the in LZ the highest peaks are at high tones as in the two other programs they are in the shadows. The differences are also visible in the image. The Canon's version of the paint of the tram is faded and worn and in LZ the reds and yellows shine bright. RT is somewhere in between, little emphasing reds, nearer to Canon.
I will continue experimenting.