Color management in Firefox

I’ve bought ColorHug to make color profiles for my monitors. ColorHug is a great device for the price and it works without problems on GNU/Linux. Using it together with dispcalGUI I could easily create the color profiles.

Making a color profile is one thing while applying it is another problem. My experience with color management (and image processing generally) on GNU/Linux is that there are many bugs in the graphics tools and libraries and things can easily get wrong at any place. It is necessary to check everything for correctness.

Here is what I had to do to get the monitor profile correctly applied in Firefox. First, the profile must be installed as a system profile for the given display. This can be done e.g. using dispwin -I from Argyll. Note that setting the monitor profile in Firefox preferences instead didn’t work for me.

This is everything what had to be done for Firefox till version 16. There is a change in Firefox 17 fixing application of some color profiles while completely breaking application of the profiles created with dispcalGUI — it looks like they are applied in reverse. After many experiments I’ve found that the following combination works correctly: Create LUT-based (not matrix-based) profile in dispcalGUI and enable ICCv4 in Firefox. The latter can be done by entering about:config and setting the option gfx.color_management.enablev4 to true. Only under those conditions I could get proper image colors in Firefox.

Unfortunately even that doesn’t work flawlessly. There’s another bug in Firefox that corrupts displaying some PNG images under those settings. But this is a relatively minor problem.

Sensor cleaning

My digital camera sensor got dirty enough and it was no longer possible to clean it just by softly blowing air to it. So I looked for a more powerful cleaning solution. After some searching I decided to try Pentax Image Sensor Cleaning Set O-ICK1. It looked simple and didn’t require any liquids. Does it work?

I wasn’t much successful when carefully following the instruction manual. But then I applied somewhat stronger pressure than suggested and it started to work very well. My sensor is sufficiently clean now.

Here are sample images (crop of the same resized area) before and after the cleaning (please ignore the sky in the background and look just at the dust spots):

before-cleaning.jpg after-cleaning.jpg

Is it safe to use old flashes on modern cameras?

Sometimes the possible consequences of connecting old flashes to modern electronic cameras (both digital and film) through hot shoe are discussed. The problem is high voltage (up to at least 300 V) of those flash units on their contacts, exceeding the standard limit of 12 V. I’ve never heard about a destroyed camera from direct user experience, but people are warned not to try such things.

What’s my own experience? An old simple hot shoe flash with voltage about 90 V on its contacts usually worked with my Pentax MZ-M camera, but I sometimes experienced delayed mirror return (for about half a second) after taking a snapshot. I was more cautious with my other body, Pentax Z-1, reported to be sensitive to high voltages. I once attached another flash unit, 40 V, to it. Two snapshots went fine, but on the third one it actually happened what the rumors had warned about: the camera got completely frozen and I had to remove the battery from it to get it alive again. However no other damage has happened.

I no longer risk damaging my cameras by using old flash units. I bought a used Pentax flash unit for €15, with safe voltage. It is only a bit stronger than common built-in flashes, it doesn’t have any TTL etc., but it works, it’s safe, cheap, small, light, inconspicuous and communicates with the Pentax cameras. It’s enough for my occasional flash use.

This is my warning to other photo amateurs: Although no permanent damage has happened to my cameras, I can confirm that using old flashes with voltage higher than 12 V on their contacts may cause at least temporary malfunctions. And it’s not true that Pentax cameras are safe up to 600 V.

Printer calibration

Some time ago I’ve finally managed to get my Epson R220 printer somewhat calibrated. Standard Gutenprint drivers suffer from strong green cast on this printer and I wasn’t successful to get it corrected directly in Gutenprint. Trying to play with the driver color settings has led me only to other problems, replacing one kind of color cast with a different one. Much better than standard settings but still not always usable. So the only way to print photos on my printer was performing printer color calibration. How did I do it?

First I installed Argyll color management system. It’s not included in Debian (I guess not many people perform color calibration regularly and they are scared of irregularly maintained software with lots of possible problems) but it can be compiled and run easily. It’s just not easy to use it. But it contains complete documentation, so with enough time, patience, ink, and paper it’s possible to get the desired results. I didn’t have enough time during last year so it took me more than one year, but it seems to work now.

The first step was to calibrate my desktop scanner. This was necessary to scan the printed samples for calibration processing. I ordered a scanner color calibration target from Wolf Faust and followed instructions from Argyll documentation. This step was relatively easy and I got my scanner calibrated soon.

The next step was significantly harder. When I tried to generate color patches for my 6-color ink printer Argyll created just greyscale patches. I didn’t understand it, although the Gutenprint driver apparently uses inks other than black even on greyscale images (as long as color printing is enabled), I decided not to go this way. So I generated and used patches for an RGB printer. Yes, it’s probably completely wrong from the point of serious calibration, but it basically works. First I tried to generate the patches for the target 10×15 media but the number of the patches on this area was too small and the calibration results were bad. I didn’t have a larger piece of paper of this kind so I used a different kind of paper in A4 size. Professionals would probably fall faint reading this but I wasn’t willing to spend another €15 for paper in order to print our family photos perfectly. Then I had to scan the printed results and to process them with Argyll. The process was smooth once I had managed to use proper commands with proper arguments and proper use of the srgb.icm file (taken from digiKam).

The final step was setting the color profile in PhotoPrint. This was easy and worked very well.

Of course my calibration process had several serious flaws: I used a desktop scanner instead of a proper measurement tool, I generated color patches for another kind of printer and I used different kinds of paper for calibration and printing. But the results are still better than any of my previous attempts of manual adjustments. They are not perfect, but my old digital camera is not either, not mentioning my uncalibrated monitor. And I’m glad that faces on the printed photos are no longer green nor violet. This makes my family satisfied enough :-), so this poor man color calibration fulfilled its purpose.

Scanning films with flatbed and film scanners

Film scanners are often claimed to be superior to flatbed scanners when scanning 35 mm films. The harder thing is to find actual facts supporting such claims. Actually it’s possible to find samples suggesting there is no significant difference between the scanners. And even Minolta was able to find the only relevant argument for film scanner superiority on their site: better optics.

The fact is that I was sometimes dissatisfied with a cheap flatbed Epson Perfection 2480 Photo scanner. I can compare its outputs with a dedicated film scanner (Nikon LS-40 / Coolscan IV) now. Indeed, there are significant differences in the results.

As for image quality I could observe the following:

  • Every film defect (scratches, dust, garbage) is clearly visible in Nikon scans. Without digital ICE the Nikon scanner would be almost unusable. Epson is much better in this area and thus it’s the only option for scanning my old b&w negatives.
  • The true resolution of the Nikon scanner is clearly superior to the Epson, despite their nominal resolutions are almost the same (2900 versus 2400 ppi).
  • Nikon is much less prone to grain aliasing.
  • Nikon output can be used without further processing, sometimes small level of USM improves the image. Epson output is very soft and typically requires strong USM followed by noise reduction and additional USM to get well looking results (but still somewhat inferior to unprocessed Nikon output).
  • Epson suffers from irregular annoying stripes in monotone image areas, in the direction of scanning. This is one of the worst and completely unavoidable problems of the scanner.
  • Nikon has shallow depth of field and the scan is often sharp in the center (the default focus point) and unsharp near the film field borders. Special care is needed to reduce the effect. Epson is much better in this area.
  • Epson poor film holders make the scans prone to terrible reddish artifacts near the both ends of film stripes.
  • There seems to be no relevant difference in the dynamic range capabilities of the scanners when scanning negatives.

To summarize: While one can often receive similar results from the scanners, there are situations where only the film scanner is able to produce good results. IMHO it’s really worth to consider investment into a dedicated film scanner instead of a cheap flatbed. On the other hand the flatbed scanner may be superior when scanning imperfect films when digital ICE can’t be used.

Besides the image quality convenience may also matter:

  • Epson is much faster, I’d say I can scan a roll of film with it twice as faster than with Nikon.
  • Nikon can load film stripes itself (some flatbeds can do that too). On the other hand it’s sometimes difficult to force it to move the film field to the desirable position so that it could be scanned whole, without cutting out any part of the film field area. I don’t know whether this is a problem of the scanner or of something else (driver? user?), but it’s annoying.

And finally, which low-end film scanner to buy? The cheap film scanners such as Plustek or Reflecta don’t seem to provide quality comparable to standard middle-range film scanners. A used Nikon LS-40 / Coolscan IV seems to offer very nice quality/price ratio for an advanced amateur. Older Nikons are SCSI devices, i.e. quite inconvenient to use with contemporary personal computers. Nikon LS-50 / Coolscan V is one of the rare middle-range film scanner models still in production. Minolta Dual scanners are cheap, but they don’t have Digital ICE (which makes their use very inconvenient), they seem to be more prone to grain aliasing and they are infamous for banding problems. If I understand the technology right, Nikon scanners are superior in their LED light source: It’s very reliable and there is no color interpolation (each pixel is scanned in all the color channels separately). Minolta Elite 5400 scanners look very nice but they are more expensive and the II model is known to be prone to defects. I don’t care about Canon scanners as they are completely unsupported in SANE. As for SANE support, AFAIK only Nikon LS-30 and LS-40 and Minolta Dual II and III are reported to be fully supported.

HTH, although it’s all mostly a personal opinion of course.

Damaged films

One of the main advantages of digital photography over film is that all the process is in your hands. With film at least its development is usually left to a laboratory. And this is a problem, I’ve experienced a lot of troubles with it: scratches, sticked garbage, fingerprints, even exchanging my roll of film with one of another customer. In the better case I can partially repair some of the damages spending a lot of time on retouching, in the worse case the shot is lost. I’m not a photographer who takes a lot of pictures and then chooses a few pictures from a roll of film, I usually spend significant amount of time on taking each shot and don’t shoot the same picture twice. So if they damage my shot, it’s completely lost.

I don’t want to risk those problems anymore. As I don’t know how to find a good laboratory in Brno, I have two alternatives. Either sending my films for development to PHOTO life’s CREATIVE LAB (they claim they handle everything in the process very carefully) or developing the films myself. With my low-volume production I’ll probably try the first choice. It means about 3 € extra cost for postage, but it still looks like the cheapest way to get the thing done right.

BTW the laboratories in Brno that show complete incompetence are Fosh foto and Fotex (at Kobližná).

Scanning software

Scanning software should deliver maximum information in the best possible form. It’s not necessary to avoid further processing, but it’s important to keep it possible and to perform processing steps that can be made automatically without losing important information. Choosing right scanning tools is important as mistakes in this process may result in the necessity of repeated scanning and processing. How is it with scanning negative films on Epson Perfection 2480 Photo?

The original Epson scanning software on Windows usually produces good results, but one must be careful to actually receive them. Obvious selections are setting colors to 48-bit (or 16-bit in case of bw negatives) and resolution to

  1. “Improvement” options should be all disabled, especially dust removal

that in my experience actually doesn’t remove any dust but removes many details instead (this is a pure software algorithm, the hardware doesn’t support any dust removal features). Note that unsharp masking has to be disabled for each scanned film field individually. When you forget it, you receive bad results when you try to apply unsharp masking later yourself. Usually the software produces good colors (better than I’m able to get from the negative by other means now) although manual corrections are often necessary during post-processing, as is common with color negatives. It happened to me once with a few strongly overexposed film fields that the software has chosen very aggressive color clipping and I had to adjust histogram settings and rescan the given fields again. The Epson software requires a lot of mouse clicks (on average more than 2 for each scanned field) and suffers from memory leaks, requiring occasional restarts.

On Linux the scanning process is more challenging. The SANE driver supports all the crucial hardware features and scanning half a film strip requires just a single scanner button press (when you use scanbuttond) and no mouse clicks. But here is a small 1:1 sample of what you receive (contrast is much increased in all the examples to demonstrate the problems more clearly):


Note two things:

  1. The very ugly stripe about one quarter from the left in the image. This is not a scratch on the film, this is a systematic defect.
  2. The regular pattern of vertical one pixel wide darker and brighter stripes around edges of dark areas.

As for the special ugly stripe, it helps turning quality settings off (i.e. removing the ‘–high-quality=yes –quality-cal=yes’ scanimage command line options). I guess their meaning is reversed in the driver by mistake. So here is new result:


The extra stripe is gone, but the regular stripe pattern is still there. I’ve no idea why it’s there but I’ve seen something similar in the samples from other scanners on the net so it’s likely to be some common hardware feature. FWIW, scanning direction is vertical here. No such apparent stripes are present when the same image is scanned with the Epson software on Windows:


So I tried to get rid of the stripes by averaging each two neighboring stripes into a new “neutral” stripe. This operation shouldn’t lower resolution of the image, it may just soften it (and the actual scanner resolution doesn’t correspond to the scanned image size anyway). So it should be safe. Here is what I received after applying the following imagemagick commands:

convert -crop 199x158+0+0 image.png crop1.png
convert -crop 199x158+1+0 image.png crop2.png
composite -blend 50% crop1.png crop2.png result.png


I think the result is pretty close (except for contrast adjustments) to what Epson software produces, so it’s probably the way to go.

All the things presented here may look clear and simple. But it took me long time coming from the first naive scanning attempts to discovering why the scanned images don’t look well and finally finding out all what’s described above. Now I know supporting a piece of hardware doesn’t mean just providing raw low-level drivers to the hardware. The hardware specific post-processing part is also very important and the user may receive poor results if this part is missing.

Scanning print films with Epson 2480

I’ve switched almost completely from using a compact digital camera to using a film camera this year. I scan my 35 mm negatives with a low-end flatbed scanner, namely Epson Perfection 2480 Photo. It is possible to obtain reasonable results using that cheap device, but it’s not easy. I’ve been learning a lot during the process and I’d like to share my experience in the posts here, perhaps it helps someone.

First, what can one expect?

As for the scanner dynamic range, I think it’s sufficient for scanning amateur print films, I haven’t observed any problems in this area.

As for the scanner resolution, Epson claims something about 2400 dpi regarding that scanner. I’d say such numbers are pure marketing crap nowadays for two reasons: 1. it’s not defined what the number means; 2. whatever it’s supposed to mean it has probably little to do with reality, i.e. the real scanner resolution. According to internet rumours and my own observations, such as down and upsampling scanned pictures and comparing scans with prints, I estimate the actual scanner resolution performance is very roughly around 1000 ppi. That means the spatial information the scanner is able to capture from a standard 35 mm film field is present in a picture of a minimum size of about 1500×1000 pixels.

So in theory the scanner should be sufficient for both my primary target medium, a 1280×1024 computer screen, and my secondary media, occasional prints not larger than A4. In practice it’s not that easy but more on this next time.

Wouldn’t it be worth to buy a better scanner? I don’t have any experience with current more expensive scanners, but from what I’ve read and seen on the net, I think they provide somewhat better results with significantly higher comfort for much more money. Higher Epson flatbed scanners such as 4×90 or V7x0 produce better results and offer hardware features for dust removal, but increase in the device cost is significantly higher than increase in the resulting scan quality. Low-end “4000 dpi” dedicated film scanners give even better results for even more money. Drum scanners produce much better scans than Epson 2480 for 100 times more money. Basically it’s your choice whether you invest much more money into better scanning hardware producing good results or much more time into scanning process using a cheap scanner producing acceptable results. Or whether you buy a good digital camera equipment and get rid of scanning entirely.

Film sensitivity

When I scanned photos from the Fuji Superia 400 film I was very unhappy with grainy shadows. The grain seems to be really worse there than in brighter areas even when considering the effect of higher noise visibility in dark areas. I couldn’t get rid of it even when I tried to significantly overexpose. By chance I found explanation of the problem in an old issue of the Czech PHOTO life magazine.

Actual sensitivity of negative amateur Fuji films (and this is likely to apply to other vendors’ films as well) is very different from what one could assume looking at the declared ISO number. First, it is actually significantly higher than declared, protecting you from underexposition. Second, maximum sensitivity (i.e. the ability to capture minimum light without underexposition) is about the same regardless of the declared sensitivity, the difference between Fuji Superia 100 and 400 is reported to be only about 0,5 EV. When you expose Fuji Superia 100 at ISO 50, you can go up to 4 EV from the middle towards darkness before the material gets underexposed, while when you expose Fuji Superia 400 as ISO 200, you’ve got only about 2,5 EV.

This explains what I observe – even when overexposing the ISO 400 film twice, there is a big risk of underexposed shadows, resulting in overgrown grain (note that according to Fujifilm specifications standard grain size should be about the same in properly exposed Superia 100 and 400). Indeed, scanning my latest Fuji Superia 100 film seems to confirm the facts. When I compare results from an ISO 400 film exposed as ISO 200 and from an ISO 100 film exposed as ISO 70, there is not much difference in the look of the grain in the highlights. But the grain is much worse in shadows of the ISO 400 film, while in the ISO 100 film the grain is about the same as in highlights there. So there is no point for me to use an ISO 400 film which is more expensive and provides lower dynamic range, while it offers only slight advantage in maximum sensitivity.

Sensitivity is one of the areas where digital easily beats film. Where I’m limited to ISO 50-100 with film, good digital cameras can go safely up to ISO 400-800. Additionally, the higher depth of field allows to use one step wider aperture. And finally, image stabilizers become common, which adds further 2-3 steps. Summed up, DSLRs can provide at least 6 EV advantage over film in nature photography.

Moonlight photography

I’ve finally managed to process my photos from the last winter. You can look at samples of my photos taken under moon light. They are not good photos but they show how moonlight photography can look like. Note the photos are somewhat shaky because I forgot the remote control at home and had to hold the shutter button by hand for the whole time of exposure.