Autofocus wavelength dependency in a Pentax K20D

I take substantial amount of my pictures in low light conditions.  However, the autofocus of my K20D has proven to be a poor companion under these circumstances. I usually have to fight with problems of getting the focus right. The problem is made even worse by the fact that the camera triggers the AF light of the flash far too late. There is some brightness in which the camera can’t focus quickly or not at all but doesn’t attempt to use the flash’s AF illuminator. I have remedied this condition with the development of several AF illuminator assistants, basically a second- manually triggered- AF-illuminator. Although I used pretty strong light sources in them, performance was still sub par.  After reading about the “Pentax yellow light focus problem” that Ricehigh described, I decided to do some tests myself.

Basically what is known from other Pentaxians is that under incandescent illumination a front focus of the camera can be observed. It has been speculated that this is related to the amount of infrared radiation contained in this light. Therefore I tested whether the Pentax AF reacts to near IR or UV light. The good news: no it does not at all. I tried UV LEDs and very near IR LEDs, just at the border of human perception, and with both I could not get any AF lock-on. I then testes a range of LEDs with comparable brigthness on a focus test chart (please note my excellent hand drawing skills ;-)). Here are the results (left is front, right is back, 45 deg angle, focus until stable, two pictures each, both where always exactly the same (every time refocused)):

Focus in white light.
Focus in green light.
Focus in red light.

What you can see is that there is very little dependency on wavelength. For none of the used wavelengths, IR, UV, red, green and blue (not all are shown) were there siginificant differences in accuracy, if the focus could get a lock-on (not for UV and IR) at all. Therefore each color should be able to do the trick in an autofocus assist light.

Then I did a second test: I again mounted the camera on a tripod and aimed it at a lamp in my dark living room.  Now I illuminated the lamp with various LEDs and tested how well the focus worked. Here are some examples:

Green AF assist.
Blue AF assist.
Red AF assist.

As you can see, each color works. Surprisingly, even the dim blue LED can get a lock-on (in terms of energy it is as bright as the red and the blue).  The surprising fact however was that the bright red LED, which even projects an image of its die onto any surface (really short focal length of the LED dome lens) caused the most problems. The focus is able to lock on but often it was not accurate. Just as it is really difficult to manually focus under red light- due to the low acuity of the eye for red- the camera had the same problem. Often the focus was slightly of to the front or back. The best results were obtained wth the green LED. Now I understand why the Fuji bridge camera of my friend Jonas uses a green LED :-) (besides the fact that in LiveView green is alwazs superior due to twice as manz green pixels)! I will try to test a green LED for my autofocus assist light as well! So please come back because I will present this neat little device shortly on my site!


What do we learn from all this? First, the K20D does not appear to necessarily show a problem with the autofocus for different wavelengths. At least not if the illumination is decent. This excludes a systematic error in the AF and makes a “yellow problem” unlikely. I have also never experienced one. For near threshold intensities it seems to be that green light can be best used for accurate AF. Lock on is fastest and most of the times more accurate than red light. Another advantage is, that green LEDs are still effective and bright and green light does not trigger the pupil reflex as badly as blue light.


This test is not really “scientific”  as there are no accepted standards for this kind of measurements. Since the spectral response curve of the AF sensor and filters in front of it are unknown, no equal luminance setup can be built. It is merely a test which just tests if there are any grave problems with the AF under different wavelengths and which of those could best be used for an AF assist lamp.

Tags: , , , , ,

Wednesday, May 13th, 2009 Photography No Comments

Review of the SIGMA 28mm F1,8 EX DG Asp. Makro

For my Pentax K20D I recently bought the Sigma 28 f2.8. I wanted to use it as a standard 50mm equivalent lens for standard photos and especially for low light portrait applications. Since there isn’t that much information about this lens out on the web I compiled this little review to help everyone out there who is wondering whether to buy the lens or not.

Build Quality

A definite plus of the Sigma. It is quite heavy for a prime but this makes it feel really solid. I like the EX finish, other people might not. Nothing is wobbly or cheap-made. The lens hood is also firmly attached to the front, reducing the risk of the objective being dropped during exchange. The lens cap however is not so well designed, because it is hard to get off while the hood is still on.


The autofocus for medium to wide distances is pretty fast for a lens on a Pentax. Only if the autofocus misses and goes all the way to makro you might have to wait a second or two until it is back at infinity. Autofocus accuracy exceeds that of my Sigma 17-70 DC, although in low light it can take a moment until the autofocus locks. Surprisingly it works until it is really dark. In the streets at night the focus works without any assist lamp being necessary. Under all conditions one might experience some “hunting” of the focus, it changes a few times the focus direction until it is really on-target. What is a bit disappointing about the AF is, that you lose the autofocus points at the very left of the frame. The lens does not work with those and focus will give completely back-focused results. The 9 points inside the inner AF-frame do work, but only the middle sensor works really well. Please note, that although my lens doesn’t show it, many users have reported terrible front or back focus! Considering the age of the design Sigma might not be able to adjust it. If you have a K20D you can circumvent this problem by using the build-in AF-correction since the lens’ ID is transmitted properly. In terms of movement the AF does extend the barrel only slightly, eliminating “pump action” dust suck up. The front element does not rotate. But considering the price for 77 mm polarizers it doesn’t really matter 😉


Sharpness is pretty good already at f1.7. It is a bit blurry, but for portraits and many other situations it is sufficient. I found my lens to reach optimal sharpness already at f2.8. At higher f numbers sharpness decreased again.

Scene for cropsScene for crops

Sharpness at different aperture settings. 100% crops at 6 Megapixels. Please not the flare appearing at f16 in the upper left corner.

Sharpness at different aperture settings. 100% crops at 6 Megapixels. Please not the flare appearing at f16 in the upper left corner.

What is remarkable, is the even distribution of sharpness. This is due to the DG design, which is intended for full frame sensors. So on the K20D’s APS-C crop sensor edge sharpness is good.  It by far exceeds the performance of the Sigma 30 mm f1.4, which shows terrible edge sharpness.


Contrast could be better, highlights tend to eat away fine structures like branches and the sun drowns quite a bit of the image in white.  A specific problem of the lens is it’s tendency to flares. At the open end flares are pronounced even with the lens hood. Stopped down the optimum is around f8, but stopped down further, another type of flares appears. In my opinion the lens hood is too small, it can be extended a bit with black paper which helps with flares without increasing vignetting.


Only visible wide open.

Chromatic Aberrations

CA’s are low and can be corrected very well. Purple fringing can occur wide open, I found it to be pretty light however. The Sigma shows some colored edges for out-of-focus objects with high contrast but I have seen worse. Here is what it looks like:

Overview of cropped scene at f1.7

Overview of cropped scene at f1.7

Crop from center of the frame

Crop from center of the frame

Crop from edge of frame with chromatic aberrations.

Crop from edge of the frame with chromatic aberrations.

The chromatic aberrations seen in the above pictures can be complitely eliminated by the Photoshop or Lightroom  CA filter.


Here are a few samples. The night time photos are all taken without a tripod at ISO 1600. Enjoy!

Tags: , , , , , , , , , ,

Wednesday, April 1st, 2009 Photography No Comments

Pentax K20D Banding Revisited

By now, quite a few people helped me out with some test shots. Thank you guys!

Here are the results so far. Please let me first say a few quick words about the analysis. All photos were taken at ISO 200 with the D-Range function turned on and exposure compensation set to minus 2, mimicking dark parts of an image. The camera pointed towards the sky and was unfocused. Please note that depending on the light source used, different channels are differently amplified, resulting in the artifact showing up in different color channels more or less. Candle light scenes, which have been proven especially cumbersome might show the artifact primarily in the blue channel because there is almost no blue light, resulting in a higher amplification of the blue channel. The analysis was done by reading in the images and calculating an average over rows of the image. This average is then filtered with a 5 pixel sliding average filter to reduce random noise. A divisive white balance ensures equal values for all color channels. Then the static part of the trace is subtracted, leaving only fluctuations comprised of noise and the artifact (if present). Therefore all numbers given for the artifact here are the absolute brightness difference in an 8 bit (256 brightness steps) image. I chose this method because the artifact seems to be mainly present in dark parts of the image and does not scale with brightness. Therefore I did not normalize it by the standard deviation or the average background. An absolute value of 2 at minus 2 f-stops corresponds to a change in luminance of about 5-10%! The stripe is therefore 5-10% percent darker or lighter than the rest of the image. This is well visible directly in homogeneous image parts and will not only be visible after extensive post processing in Photoshop! I am not debating a purely academical problem here (at least not for all cameras).
First, let’s have a look at different people: do all cameras show the problem? The clear answer is: No! At least one of 6 tested K20D’s shows no artifact at all.userDiagram.png Three other cameras do show an artifact but it is so light that it will hardly be an issue. And two cameras, including mine, do show an artifact which is visible by naked eye. Please note that one user (josei) has a negative artifact (negative = slope is negative 😉 )! Usually the stripe is a dark one, but for him the stripe is brighter then the rest (although it matches exactly the location of other cameras artifact). In one other case the artifact is negative in one channel and positive in the other (stevo). This is marked in in a display of four cameras artifacts. The other marks show no artifact (frasei). user.pngI also attached an image of the stripes appearance in real world shots. This is amplified! For the first case the stripe is visible in an unamplified version but since many PC monitors are too dark it would not be visible in this low quality web image. (The second one was shifted a bit to the left accedentially in Photoshop, try to find the band’s border ;-)) The other examples show little or no artifact.user.jpg
To test the reproducibility of the artifact I tested it against 2 variables: brightness and exposure time. One would expect to see no difference for brightness and a decline of the artifact with shorter shutter times (longer shots, more noise). However, what happens is quite the opposite. exposuretimeDiagram.pngThe artifact correlates best with the darkness of an area and not with exposure time. For different times from 1/1000s to 2 s the amplitude stays almost constant. However, while it is extremely low in bright parts of the image, where it is rendered invisible by the high background brightness anyway, it kicks in most in dark image parts. At -2 or -3 f-stops it is worst.brightnessDiagram.png
So how should one summarize the result?

  • The stripe/banding artifact (the pattern noise type described here, I am not talking about banding from pixel to pixel!) in Pentax K20D cameras is present in most cameras but low for the majority of them
  • While some cams do not have it at all, others are so severely affected that the Pentax service should take a look at them
  • For affected cams, shots at low ISOs and especially with the D-Range function turned on can show banding under difficult conditions like dark clouds or candlelight scenes. High ISO shots without noise reduction might be completly destroyed (one example, not shown)

Tags: , , , , ,

Tuesday, March 31st, 2009 Photography No Comments

Banding Artifact of a Pentax K20D

The newest addition to my collection of cameras is a Pentax K20D DSLR. It is now my main camera which I regularly use. Considering the extremely good price point and all its features, it is a really great tool. There is nothing negative I could say about it, except one special problem: pattern noise banding at the left side of the frame under low-light, low-ISO conditions. It’s worst when the dynamic range compression is used. There has been quite some debate on the Internet about it. One group of people have the problem and say it’s real, the other group wants to defend the Pentax altar (which I usually would also do) and accuses the first group of broken memory cards and exaggeration via increasing exposure in postprocessing. A typical claim of this group would be “You can get everything when you brighten the image in Photoshop!”. Since I discovered the banding issue in my pictures as well, I decided to do a little testing. When I spotted it in an image which was not processed for the first time (I’d known it from shopped photos) I was trying a few things for a still life photograph:


And there is the first problem: if your monitor settings are not ideal, you might see little or no artifact. But several posters in discussion groups have fallen into that fallacy: just because a low-quality web snapshot shows little, does not mean the image is ok. In fact, on a calibrated monitor with the full resolution RAW-file opened, the artifact is prominent and destroys the picture.  Since the banding ruined several of the images in this series, I decided to investigate the problem. I took a few series of test shots of out-of-focus, gray overcast sky. These images are then read into a little program I wrote, which averages all rows of the image so that a vertical banding will appear as a dip or bump. The is average trace for each color channel is additionally smoothed with a 5 pixel, phase neutral, sliding average filter (the artifact stays in place, random noise is smoothed!). Out of that average trace the leftmost 20% of the frame are plotted. The banding shows up as a region with lower luminosity from row 1 to row 279 (at 3008 pixel frame width) and a gray line marks the border. Here are the parameters for the images: in-camera jpg, 6 MP resolution, colors set to natural, noise reduction medium, contrast +-0, manual WB on the clouds. Please note that the fluctuations are not the artifact but image noise and the linear trend is due to the vignetting of the used Sigma APO DG 70-300 mm at 300 mm with wide open aperture! The banding artifact is the region with overall lower luminance from 1 to about 280 (gray line). Please read the explanations below the graphs!!!


Picture 1 of 5

This is a plot of the base sensitivities of my K20D. As you can see, the artifact, the little bump around the line, is only visible in ISO 100 and 400 when DRange is off. Due to the normal exposure compensation the artifact will not be visible in the image without postprocessing. ISO 200 and 800 seems to have no artifact.

As you can see, the artifact is limited to special combinations of ISO, DRange compression and image brightness. This is probably the reason why it was not necessarily reproducible for many people.  What happens is the following: ISO 100 and 400 in particular show the artifact. ISO 200 and 800 and above are less affected. The absolute value of the artifact seems to be rather constant, explaining why it can only be seen in dark regions (-2 stop images), where it is larger relative to the overall luminance!Enabling the DRange compression does two apparent things: firstly, the ISO 100 option disappears from the K20D’s menu. ISO 200 is now lowest. And secondly, the artifact is shifted by one ISO setting. Now it appears at ISO 200 and 800, with 400 and 1600 almost unaffected. What the DRange probably does, is just multiplying dark regions with some factor, making them brighter, thereby increasing effective ISO and “calculating” the artifact into a perfectly good image. Damn! So what do we know?

  • The artifact affects paradoxically LOW ISO values, it is completely absent above ISO 1600!
  • Not all ISO values are affected
  • The effect has constant amplitude and is not multiplied by the real ISO of the sensor
  • However, it is LARGELY increased by the DRange function
  • Underexposed parts of an image are affected worst
  • ISO 200 with DRange produces the worst results. Beware!
  • Independent of: exposure time (at least up to 2 seconds), memory card, image stabilization

Here are two more pictures, showing a clean, correctly exposed ISO 200 picture and an UNPROCESSED! picture at ISO 200 with DRange on at -2 stops underexposure. This vividly demonstrated, that this artifact is NOT something which is only brought out by image processing. It is visible in dark parts of normal images at low ISO, which is, in my opinion, unacceptable!



What does this mean? I would suspect an offset problem in the sensor or it’s amplifiers! This is an image from the net, which shows the same effect even more pronounced:


What you can see is, that, just as in my camera, there is not just the stripe on the left side, but also one on the right side. Interestingly this one has no clear border! An indication that the sensor itself is the problem- not a chip which processes one part of the image later on! Since the amplitude of the effect is constant, it does not show up in bright parts of the image where it is just too small relatively. It could be very well an offset problem of the pixels amplifier! A different sensitivity of individual photo sites is highly unlikely, since the effect does not scale with brightness. So but what can we do now? Here is a list of suggestions:

  • My analysis shows which ISO/DRange  constellations you might want to avoid
  • Stay away from the DRange function. It has very little positive effect but apparently destroys some shots!
  • If you own a K20D, please take a 6 mega pixel JPG picture at ISO 200, with DRange on and exposure compensation set to -2 stops against a white wall, sky or a sheet of paper. Don’t forget the white balance. Please don’t remove the EXIF! Then use the email address on this site to send it to me: Mail me! I will post it here and we can check, whether this problem affects all K20D’s, just some of them. If it is just some, the Pentax service might be able to help us out 😉 And even if not: since the effect seems to be constant a new firmware version could be able to fix it!

So. And now, last but not least, the final result of my still life session. As you can see, it’s possible to get great shots in difficult lighting if you know the possible traps 😉


Tags: , , , , ,

Friday, March 27th, 2009 Photography No Comments