This is my cyberhome!

November 12, 2014

Canon EOS-M – Poor Man’s RX1

Filed under: Photography — Manish Bansal @ 12:07 am
Tags: , ,

The best way to sum up Canon EOS-M (with 22mm lens) is this – It’s a poor man’s RX1. Of course it will not match RX1’s combo of full-frame sensor with a Zeiss prime but it comes awfully close. And all for a paltry sum of $300 which is what it was selling for as of November 2014.

I have read lots of reviews and examined hundreds of image samples from all kinds of cameras, including the aforementioned RX1. And I can say without any hesitation that this tiny 22mm f/2 lens has ridiculous amounts of resolving power. It’s up there with the best of them. In fact, it’s being limited by the relatively “low-res” sensor. Here is an example.

This is the complete image:

And here is a 100% crop:
Canon 22mm f/2 - 100% Crop

You can actually read those letters and read them comfortably! Notice how each letter is still distinct even at this tiny size. This would have turned into a blurry mess on a lesser lens. That is some serious resolving power. If this does not make your hair stand up, you are either dead or a medium-format user 🙂

I can only imagine what this lens could do on a higher-res sensor. Here is hoping to a 36MP M3.


February 25, 2009

How to make Nikon Capture NX2 run faster.

Filed under: Photography,Software — Manish Bansal @ 10:14 am
Tags: , ,

To say that Nikon Capture NX (or Capture Nx2) is slow would be an understatement. The reason for its slowness is that it ships with older versions of certain Windows files which it uses. So all we need to do to make it run faster is to install the latest and greatest versions of these files. It really is that simple and it makes a significant difference. But why Nikon doesn’t document it or doesn’t do it by default is beyond me.

Here are the steps (Please read the whole post before proceeding with the install):

1. Download and install Microsoft .NET Framework 3.5 with Service Pack 1 from this page on Microsoft’s site. Capture NX2 installer specifies that it needs .NET framework 2.0 but if you install .NET framework 3.5, you do not need .NET Framework 2.0 or any other earlier version.

Note: If you do not want to install .NET Framework 3.5 for any reason and want to use version 2.0 itself, download the latest version of 2.0 with SP1 from this page.

Install updates, if any, through Windows Update (in Internet Explorer). If you already have .NET framework installed (2.0 or later), use Windows Update to get the latest version. Reboot if prompted.

2. Download and install Microsoft Visual C++ 2008 SP1 Redistributable Package from this page on Microsoft’s site. It’s a very small download (only 4 MB). If you install this, you do not need Microsoft Visual C++ 2005 Redistributable Package or any other earlier version. Capture NX2 ships with a very old version of this file (from 2005 or earlier) which is the main reason it runs slow.

3. Reboot your computer.

4. Install Nikon Capture NX (or NX2). If you have already installed it, you do not have to install it again. But if you are doing a fresh install, it’s better if you install it in the end.

5. Enjoy editing. (more…)

December 15, 2007

Making your DSLR show Linear Histogram

Filed under: Photography,Software — Manish Bansal @ 4:39 pm

In addition to having greater flexibility during post-processing, one of the main reasons for shooting raw is to capture greater dynamic range. But if you are relying on the histogram on your camera’s LCD to judge exposure, you may not be capturing the full dynamic range that your camera is capable of.

The Problem:
The histogram shown on the LCD of a digital camera is based on the gamma-corrected jpeg image and not on the linear raw data. This is true even if you are shooting raw. It is not possible technically to create this histogram from raw data because raw data is unusable until it is processed and converted into an image. Since the raw files typically have an exposure latitude of one f-stop and the blown out highlights can be recovered easily in the raw converter, we don’t want the in-camera histogram to treat this as over-exposure. Otherwise we’d be doing negative exposure compensation to get a pleasing in-camera histogram and thus losing valuable shadow detail. In other words, instead of following ‘Expose to the Right (for jpeg)’ (ETTR) principle, we want to follow ‘Expose to the Right (for raw)’. We want to push the shadows as far to the right as possible without really blowing out the highlights. And we want to do this because the way a digital sensor works, shadows are given very little importance when compared to highlights.

Human Vision vs. Sensor Vision:
Imagine you are sitting in a room where there is one light bulb of 100w burning. You can see things around you and the room appears to be at a certain level of brightness. Now, if a second 100w bulb is turned on, the room appears brighter but it does not appear twice as bright. You’d need lot more bulbs to make the room appear twice as bright. The same is true of human ears when it comes to listening ability. Doubling the sound pressure does not make the music sound twice as loud. This relationship between the actual light intensity and perceived light intensity is said to be logarithmic in nature. In other words, an increase in physical stimuli does not produce an equal increase in its perception. This relationship is described in mathematical terms by Weber–Fechner law or Stevens’ power law.

On the other hand, digital sensors (CCD or CMOS) in our digital cameras are linear. Doubling the ambient light will make things appear twice as bright to the digital sensor. This is an important point as the raw files in our digital cameras store linear data.

Linear Data:
The digital sensor in our cameras being linear, the raw files produced by them are also linear. The brightest f-stop in a linear file is twice as bright as the next f-stop and thus requires twice as many levels. In a 12-bit raw file, there are a total of 4096 brightness levels. That means that the brightest f-stop has 2048 levels in it, the next f-stop has 1024 levels and so on. The deep shadows in this linear file will have only 16 levels! Imagine the banding that will occur if you try to open up these shadows. Thus the brightest f-stop has far more levels in it than our eyes can perceive while the lower f-stops have far fewer levels than required. This non-uniform distribution of luminosity data can be fixed by applying gamma correction on the linear data.

A cathode-ray tube (CRT), which is used in the computer monitors, is inherently non-linear. The intensity of light reproduced at the screen of a CRT monitor is a non-linear function of its voltage input. This relationship between the input voltage and the output intensity is described by a parameter called gamma. To compensate for this non-linearity, the input signal to a CRT is encoded in such a way so as to make the light produced by the monitor perceptually uniform. This is called gamma correction.

As it turns out, the non-linearity of our eyes is very nearly the inverse of non-linearity of CRT. Thus gamma-correcting a raw image (converting to jpeg) not only takes care of the CRT non-linearity, it is also the best perceptual encoding for visual data. It makes the best use of limited bits (8 bits or 255 levels) available to achieve the most appealing visual reproduction. MP3 encoding does the similar thing for audio data. Note that it’s only the input to the CRT (jpeg on the hard disk) which is gamma-corrected. Once an image is displayed on the CRT screen, it’s as good as seeing the image subject in real life. It is this gamma-corrected image from which the LCD histogram is derived.

LCD Histogram:
To create an in-camera histogram out of raw data, four things have to be done. First, the raw data has to be de-mosaiced, and second, a color space has to be imposed on it. The third step is to apply gamma correction. If a histogram were to be plotted at this stage, it would be bunched up to the left because even though the brightest f-stop occupies half the total number of levels (2048 in a 12-bit raw file) and thus the complete right half of the histogram, there are very few pixels in it. This is true for typical images which comprise mostly of mid-tones and do not contain much shadow or highlight data. This is the histogram (from linear data) that we are after.

The fourth step is to apply all other settings like sharpening, contrast, saturation etc. and create a jpeg image. This jpeg image is then used to plot the in-camera histogram. This histogram looks very different from the linear histogram because gamma correction spreads the luminosity data uniformly (perceptually) across the tonal range. As long as the linear histogram does not show highlight clipping, we are ok even though the gamma-corrected version might indicate that clipping is happening.

So all we need to do to get a linear histogram is get rid of gamma correction and we can do that through custom curves (on Nikon cameras at least).

Custom Curves:
Most of the Nikon DSLRs have the option to upload a custom tone curve to be applied to the jpeg images and hence to the in-camera histogram. The custom tone curve (or the default tone curves for that matter) is comprised of two parts – an implicit gamma correction and the actual tone manipulation. All the tone curves work on gamma corrected images by default. What we are looking for is a tone curve, which:

  1. Does not apply gamma correction so that our data stays linear, and
  2. Does not apply any tone manipulation so that the linear data stays pristine.

Enter ToneUp Studio.

Applying a Custom Curve:
ToneUp Studio is a raw converter written by Todd Gibbs, and indie software developer. For all of $14 dollars, it not only provides custom curve uploading, but also tethered shooting (only for Nikon cameras). And you have the option to use Nikon SDK so that you see your images exactly as Nikon intended. Here is what is to be done to make your camera show raw histogram using ToneUp Studio (This feature is available only in latest beta as of now).

I have tested this process on D80 and it should work fine on other Nikon cameras too. Please do check the camera compatibility list on the author’s website.

  1. Put your camera in PTP (Picture Transfer Protocol) mode instead of USB mass storage mode and turn it off.
  2. Connect your camera to your computer with the USB cable and turn it on.
  3. Launch ToneUp Studio. You have to connect your camera before you launch this software otherwise it won’t recognize the camera.
  4. Go to Edit-> Preferences and enable the option to “Disable Gamma curve when uploading curves”.
  5. Go to File->New Curve. A new window with a straight line curve will be displayed. Choose File->Upload Curve. A progress bar will be displayed while the custom curve gets uploaded to the camera.
  6. Turn off your camera and disconnect.
  7. In your camera menu, choose Optimize Image->Custom Tone curve.
  8. Shoot.

That’s it. The images on your camera’s LCD will appear too dark but that’s ok. When you open your images in a raw converter, this custom curve will get ignored and you’ll see a normal (gamma corrected) image. If it looks over-exposed, just use the highlight recovery slider and bring back the detail. If you are using Capture NX or any other Nikon SDK based software, just choose a different tone curve.


  1. ToneUp Studio
  2. Expose to the Right
  3. Exposing for RAW
  4. Weber-Fechner Law
  5. Steven’s Power Law
  6. Gamma Correction
  7. Gamma FAQ

August 12, 2005

Best values for digital camera settings!

Filed under: Photography — Manish Bansal @ 9:31 pm

Back in the days of film, I used to own a Yashica MF-2 camera. It was as simple as a camera could get. There were no menus to fiddle with, no knobs to turn, and just one button to release the shutter. It didn’t even need the batteries if you didn’t want flash. And I should mention, it has never given me a technically bad shot – ever. All you had to do was press the button. How could you go wrong with that?

Then came the digital cameras and the question became – how could you ever get it right? My digital camera, an Olympys C-760, has more than 50 different settings! As Scot Adams said in Dilbert – we have come from simple tools like pointy wooden sticks to convolulted things like computers but our brains have not evolved at the same rate. And looking at my digital camera, I can personally vouch for that.

There are two type of settings in a digital camera. Ones that are same for each shot and ones that vary from shot to shot. Image quality (jpeg compression) is a fixed type of setting. You don’t want a lower quality for one shot and higher quality for another, assuming you don’t have any kind of strange fetish related to images. White Balance, on the other hand, has to be changed from shot to shot. Actually I don’t change it that often but all the pros say that they do. So there must be something to it. Here is what I do for fixed settings:

Keep it ‘Off’. If your camera doesn’t have an explicit ‘Off’ setting, keep it to a minimum. I always used to keep it at 0, thinking that this would turn the sharpening off. It was only later I found that the scale was actually from -5 to +5. There is a reason people recommend to RTFM. A few reasons why in-camera sharpening is bad –

  1. Different photos need different type and differnt amount of sharpening. Digital cameras usually employ Unsharp Masking but the only thing that you can vary in that is the amount, not the radius, or the threshold. And that’s where the trouble lies. A tree shot with lots of leaves needs lower threshold than a Facial close up. Even if you could vary those other parameters, it would be too tedious to adjust it for shot to shot. So just turn it off and use your judgement later instead of leaving it to the camera.
  2. The sharpening should always be assessed at 100% size. Those tiny 2″ LCDs just don’t cut it. And you have to fiddle with the sliders a lot before you get the look you want.
  3. USM is not the best technique to sharpen photos. There are lots of other techniques which are More flexible and result in less artifacts. This alone mandates that you use PC to sharpen your images.
  4. Sharpening should be the last step in the workflow, after all the levels/curves/saturation etc corrections have been done. And then too it depends upon the intended use of the picture. Web only images need different sharpening than the ones which are to be printed. Usually you shouldn’t apply sharpening until it’s absolutely needed. Just save your edited file in PSD or XCF format without sharpening and sharpen just before using it.

This should be set to its minimum possible value. This results in a wider dynamic range which allows you to capture more detail. Increasing the contrast in-camera is like applying levels correction to the photo. A pixel which was 240 would now read 250 and the pixel which was 252 would be lost. Same applies to the shadow details too. So keep the contrast to a minimum and make sure that your histogram stretches from end to end. Even if the histogram is bunched up, it’s always possible to strech it later in photshp but there is no way to get back the details that got lost during capturing itself.

I always check the histogram right after taking the shot. Generally I end up shooting the same thing 3-4 times before I get it right but that’s ok. Good shots are worth this much trouble.

Image Size:
Use the biggest size your camera can capture. I always shoot at 2048×1536, the highest my camera can go. It’s all the more important if you shoot in jpeg. If you shoot at a lower resolution, the camera does not use less pixels to begin with. It can not do that. It would always capture the image at its native (highest) resolution and then resize it. And camera’s resampling algorithm are no match for photoshop’s bicubic resampling. So just use photoshop to resize later if you feel you don’t need the full resolution but always capture the image at the highest resolution possible.

Another reason to use full resolution is if you intend to print your shots. Digital images are typically printed at 300 ppi. So if you shoot at 1024×768, you can make a print of only 3×2.5 inches. Sure you can print this upto 4×6″ but it won’t look as good or as crisp.

Image quality:
Again, use the highest quality setting possible. JPEG is already a lossy format and further compression makes it even worse. The lower the quality (higher compression), the lesser the details in the image. That’s why most of the amateur flower shots have petals made of pure color, without any detail. At a resolution of 3 megapixels, the lowest quality JPEG file out of my camera is about 100 KB and highest quality file is at 1.5 MB! Those extra pixels count for something. The quality settings are generally named as fine, superfine etc and vary from camera to camera. Make sure you know that the setting of ‘High’ is really higher than fine or was it the other way around??. With storage being so cheap, there is just no excuse to throw away all that information. Get a higher capacity card if you have to. I use a 512 MB card which captures about 270 shots at highest resolution.

December 23, 2004

In-camera sharpening

Filed under: Photography — Manish Bansal @ 7:30 am

When I got my digital camera, I used to shoot pretty much in auto mode. Later when I became a bit experienced and started reading photography books/articles, I started shooting manual.

I knew enough about f-stops and shutter speeds and but I didn’t know anything about some of the camera settings and I couldn’t find anything on the web either. Even the camera manual was of no help. Like should I increase the color saturation using settings on the camera or should I use photoshop? What about contrast? What about sharpening? How do I know whether the camera does a better job than post-processing software.

The most confusing setting among these is the sharpening. Some people say that setting the in-camera sharpening to low or normal is actually good. While some folks are dead against using any kind of in-camera sharpening at all. After searching on the internet for many days and getting nowhere, I decided to try it for myself. One fact that adds to the confusion is that the in-camera sharpening is applied before the file is converted to jpeg.

I have an olympus C-760 UZ, a variation of which, C-765, is sold in the US. It has sharpening settings of -5 to +5, in +1 increments. As part of this test, I made three exposures, one at sharpening set to -5, one at 0, and one at a setting of +5. All these pictures were taken at the highest resolution of the camera and then cropped using iPhoto. No other editing of any kind was done. The photos were taken in low light to boost the effect of the noise. Otherwise it would be very difficult to do the comparison. Here is what I found:

Sharpening set to 0
This first exposure was made at a sharpening setting of -5. There is little noise in the shadows, especially under the big center leaf. There is some noise in the highlights too but it is not so bad. Also notice that the part of leaf visible in the lower left corner (the pointed one) has no apparent halos around it. It actually has a little but it’s hardly visible.

This exposure was made at a sharpening setting of 0. Comparing it to the exposure at -5, the noise is much more visible all across the image. Also notice the halo around the leaf in the lower left corner. It is much more prominent now. This was the setting I used to shoot at and wonder where all that noise came from. In fact I did not know that the sharpening scale on my camera went from -5 to +5. I always used to think that 0 was the lowest until I read the manual. Well, that teaches me something.

Sharpening set to +5
This exposure was taken at +5 sharpening and clearly is the worst of the lot, but that was kind of expected.

After finding out what in-camera sharpening did to the photos, I wanted to find out But how much worse (or better??) was this than photoshop sharpening? I tried many settings in unsharp masking and found that in most of the cases, photoshop outperformed the camera. The only time when camera sharpening was better was when the amount was too high and the threshold was too low in photoshop USM. The camera just does not provide the level of control afforded by photoshop. Another reason to avoid in-camera sharpening is that it does not allow selective sharpening.

Blog at