Category Archives: Guides

Homemade lens

I’ve often thought about making my own lenses, but unfortunately I’m so bad at making things I’ve always avoided it (apart from making a pinhole “lens”). But this week I was fortunate enough to be left with a broken 35mm slide projector, a Braun Novamat 515 AF-I, to be specific. It had a Braun Color-Paxon multicoated 85mm f/2.8 lens, with the usual screw mount for projectors. What’s the worst that can happen to a broken projector?

Braun Novamat 515 AF-I

Canon L lenses(that’s the pro series) have a red ring around them to distinguish them. Perhaps if you don’t look too closely you might think I’ve got an expensive lens here. Red ring? 85mm? Yep, must be expensive.

Braun Color-Paxon MC 85mm f/2.8

I dismantled the projector and removed the lens mount from inside it. “Removed” sounds so tidy… I had to use a hacksaw. Then I drilled out a Canon body cap, and glued the projector’s lens mount onto the body cap.

See, I told you I wasn’t good at making things. I believe that anything that can’t be made with a saw and a glue gun can’t be made at all :D

Canon EF mount for projector lenses

The lens simply screws into the barrel, and can easily be focused like any other manual-focus lens, although the steep thread means it’s hard to focus accurately.

I seem to have cocked up the focal-flange distance and the lens can’t quite focus to infinity. However, a quick zap with a file will allow the lens to slide further back into the barrel and will fix this. I’m not too bothered though – 85mm is traditionally used for headshots.

As the lens screws so far out of the barrel it has very good macro capability too.

Braun Color-Paxon MC 85mm f/2.8

Canon 600D with 85mm f/2.8

Crucially – how well does it work? Surprisingly well, actually. Unlike camera lenses, projector lenses usually don’t have a variable aperture. This lens is stuck at f/2.8 all the time. This gives narrow depth of fieldand can make it hard to get a sharp picture.

Perhaps more importantly, as this is a projector lens and not a camera lens it suffers from worse aberrations. Stopping down would probably help reduce them. Perhaps in the future I will make a set of interchangeable apertures out of black cardboard. I reckon this lens would look nice at f/5.6 or f/8.

The contrast of the lens is a little low, despite the multicoating. I think it would perform badly outdoors in sunlight, since it just isn’t designed for that. However, the front element is recessed in a sort of hood, which will help.

These photos have had the contrast boosted a little and the white balance fixed (I shot with auto white balance under ugly CFL lighting, combined with golden evening sunlight from the window).

In this photo of the mains plug, you can see how shallow the depth of field is, by how blurry the skirting board goes. But the lens is capable of sharp images – just look at the dots on the plug for my toothbrush.

Mains plug

In this picture of Mittens, the whiskers, eyebrows and hairs on her left ear are quite sharp. I could probably have focused more accurately given some time, but kittens never sit still for long. The black shapes in the background are cables hanging off my computer desk.

Mittens

And finally, this picture is of my jeans. Obviously when doing macro work, you need to stop down a lot to achieve decent depth of field, and that just isn’t possible with this lens. But it’s not too bad.

Jeans

 

Making a solar filter

I wanted a solar filter for my camera, for safe observation and photography of the sun. Typically these filters have an optical density of OD 5.0, which for photographers is ND 100,000. This means that only 0.001% of light is allowed through the filter.

You can buy pre-made solar filters, but they are expensive and relatively hard to find. You can also buy solar film and then mount it onto your camera lens or telescope yourself, but it is relatively fragile. If it gets a scratch, you could potentially blind yourself. Crinkled foil could also spoil the image quality.

I wanted a solution that was effective, durable and wouldn’t break the bank. Fortunately, one of my friends works in a chemistry lab and has access to a really cool machine that can coat glass filters with various kinds of metal. (This is the same chap who has the frickin’ laser that I wrote about not long ago).

Choosing a donor filter

I needed a 72mm filter for the telephoto lens I planned to use. I bought two cheap UV filters, although plain glass blanks would have been equally good.

What’s important is that the glass can be removed from the frame. Cheap filters often have the glass glued into the frame. Semi-decent ones have the glass dropped into the outer ring, and then the inner retaining ring is screwed in to hold it. Usually these screw-mounted filters have a screw thread on each side of the filter so you can stack two or more on the same lens.

The filter in this picture is the wrong type, where the glass is glued into the metal frame.

Glued filter

And here’s a close up of the kind with a screw-in retaining ring inside. This makes disassembly really easy with a pair of screwdrivers (be careful!).

Filter with retaining ring

I bought two UV filters made by Neewer, who are a relatively well-respected budget filter maker. Ordering from China, I paid less than £2 for each filter.  It was then easy to remove the glass from the frame.

Coating

In order to achieve an optical density of approximately 5, you need a total metal coating thickness of around 80nm. Trouble is, these metal coatings are very easily scratched – a fingernail would easily remove them. So I decided to coat each of the two filters with 40nm of metal and assemble the filter with the two metal coatings sandwiched together between the two pieces of glass.

The coating process is interesting. It’s done by boiling your chosen metal using an electric filament until it becomes a gas. At this stage, it will float around and stick to everything. However, you have to do this in a sealed bell jar that contains a vacuum.

First I cleaned the filters using a jet of compressed air, followed by a wiping with butanol and acetone. Any dust or grease on the filters will prevent the coating from sticking properly.

Then with the clean filters placed on the coating platform, I loaded a filament made of tungsten, wound with nichrome wire, and placed the bell jar over the whole lot. The small lump to the upper-right of the filters is a thickness sensor.

With the equipment set up, I started pumping the air out of the chamber. There’s a conventional rotary pump that can get the pressure down to a thousandth of an atmosphere, but after that you have to use a diffusion pump. For the coating to work properly, you need a pressure of just 10-6 millibars – that’s a billionth of an atmosphere. This takes about 20 minutes.

When the pressure is low enough, the chamber is sealed, and we can turn the filament on to gently begin heating the nichrome. You can’t heat it too fast, or it will all melt and drip off the filament and be wasted.

When the nichrome starts to evaporate, we crank up the current in the filament to some 50 amps. Now the whole filament acts like a light bulb, and is too bright to look at. No photos of the filament in this state, I’m afraid. I was too busy shielding my eyes.

There’s an instrument on the desk that’s hooked up to the thickness sensor I mentioned earlier. This tells me how thick the coating is, in nanometres. Here the readout is showing almost 25nm, over halfway to my 40nm target. I didn’t time how long it took to build up 40nm but it was something like 20-30 minutes.

After a while we can once again look at the bell jar, since the inside of it is partially coated with metal and quite dim. You can see how the filters now appear to be mirrors.

When the thickness meter reckons we’ve got the right amount of metal on the glass surface, we turn off the filament and gently let the air back into the bell jar. Cautiously we remove the filters from the platform using gloves (because they are hot, and because we don’t want to get dust on them).

Assembly

Now it’s just a simple matter of placing the two filters with their coated faces together, and screwing them back into the metal filter mount. Try to avoid the two filters sliding or rotating against each other. If you have dust between them, it could easily cause a scratch. Scratching one of the coated surfaces isn’t a huge problem, but if you scratch both faces then you’ll get a pinhole which allows unfiltered sunlight through, and will do a pretty good job of zapping you in the eye.

The coating is not exposed to the outside world, so this filter is no more fragile than a normal filter. The outer glass surfaces are just regular UV filters and can be cleaned in the usual way.

I found that with two pieces of glass together in one filter frame, the thin retaining ring didn’t seem that secure, so I simply used the spare frame to hold the glass in place. This means my filter is twice as thick as a normal filter, but that’s no problem.

The finished filter

And here is the filter in situ, mounted on my Tokina RMC 400mm f/5.6.

The filter in place

Testing

Unfortunately as it’s winter, it hasn’t yet been daylight during any of my free time, so I haven’t been able to use this filter with the sun. However, by comparing photos of a lightbulb in my house with and without the filter, I was able to estimate the optical density.

Without the filter, I shot the lightbulb at ISO1600, f/5.6 and a shutter speed of 1/4000s. To achieve the same exposure with the filter (keeping the ISO and aperture the same) needed about 120 seconds. That’s 200,000 times more exposure.

  • Transmittance: 0.0005%
  • Neutral density: ND 200,000
  • Optical density: OD 5.3

Given that I was aiming for an OD of 5.0, I’m pleased with OD 5.3. If my measurements are correct, that will be totally safe for viewing by eye through the camera’s viewfinder. Anyone fancy a sweepstake? :D

Soon, I hope to be able to publish some pictures of the sun taken with this filter – obviously depending on there being sun during the day at the weekend while I’m free. Cross referencing my personal calendar with the forecast for Bristol, it might be a few weeks…

Building a home darkroom

I have worked with film for some time now. From day one I developed my own black & white film at home. This doesn’t take up too much room, so I was able to do it in the bathroom (which is completely internal, with no window).

More recently, I got into printing my negatives rather than just scanning them. For printing, you need more equipment, larger equipment, and a lot of space. Our tiny bathroom wasn’t big enough, so I converted my loft into a darkroom. Here’s how.

I used the space in my loft for my darkroom. It’s quite large, and partially boarded up. I added some more boards to increase the floorspace. Luckily the loft already had a pull-down ladder, so access was easy. You can also see the extension lead I added.

The ladder

For my main work area, I used a spare dining table with two chairs against one wall. There’s no other furniture up there, although I have some boxes to keep things in.

The darkroom

There’s a standing lamp with a 100W bulb which gives reasonable illumination in the work area. The switch is in easy reach of the chair for easy blackout. I also have a clock which ticks loudly, so I can time things in the dark.

The enlarger and lamp

In a couple of areas, the boards overhang joists without reaching the next joist, and so they are unsupported. I taped these areas, and the thin trapdoor, with hazard tape to remind me not to step on them. Luckily these areas are not in the main floor area.

Hazard tape

I also attached some kitchen cupboard handles to the inside of the trapdoor, to make it easier to open from inside. Don’t want to get trapped in the loft!

The trapdoor

There’s no running water, so I bought a jerry can with a tap. This stands on a higher level than the floor, and I put a large bowl underneath the tap. The jerry can holds ten litres, which is enough to last me for several darkroom sessions. I made sure the bowl holds at least ten litres, so it will never accidentally overflow. The paler tray has some small holes at one end, so I can wash prints under running water, while submerged.

The water tank

Being in the loft, with no insulation against the outside world, the temperature can get quite low if the sun isn’t shining. I don’t personally mind being cold, but the chemicals do. I have a fan heater to boost the temperature to an acceptable working range. There’s a thermometer hanging from one of the roof supports. However, I store the chemicals in the house so they keep close to working temperature.

You can also see the safelight in the background, with a choice of three colours.

My thermometer

Also hanging from the roof supports – a drying line for wet prints. This small one only holds three or four prints, but there’s plenty more room to hang more photos.

The drying line

Of course, I’d love a larger workspace, one without roof supports, and one without fibreglass everywhere. But this will do nicely for now, and it’s all I need to develop films and make prints from my classic camera collection. :)

Your guide to buying a digital compact camera

Most of the photography articles on this site are about advanced cameras and techniques. But recently someone asked me for advice on buying a compact camera for a holiday, so I decided to write this guide. Hopefully it will be useful.

Lens

There’s a lot to know about lenses, and they have a huge impact on the quality of your photos – yet they are hardly discussed when talking about compact or point & shoot cameras.

A good rule of thumb is judging the size of the front piece of glass in the lens. In a phone camera this is probably not more than a couple of millimetres in diameter, and the quality shows. Good lenses are expensive, but aim for at least a centimetre across, and preferably more.

You can also learn something from the focal length. Roughly speaking, the more the lens “pops out” of the camera, the better. Again, phone cameras are very thin with a focal length of a few millimetres at best. Modern compacts have a motorised lens that makes them a few centimetres deep when switched on. A longer focal length usually implies a larger image sensor, which is a plus for image quality.

On most cameras, you’ll find some numbers printed on the lens. Usually this will give the range of focal lengths of the zoom lens. You can use this information to compare cameras. For example, the Fujifilm J20 in the picture above has a focal range of 6.3-18.9mm.

There is usually another number printed on the lens. This is the maximum diameter of the aperture. You don’t need to worry about what this means, but a lower value (e.g. 2.8) is better. Lower values mean the camera works better in low light where you can’t use flash, and will give nicer background blur. In the Fujifilm J20 shown above, the range is 3.1 when fully zoomed out, and 5.6 when fully zoomed in.

It’s also worth briefly mentioning optical zoom. On compacts this is given as a number like 10x, which means you can zoom in ten times closer. In focal lengths, this would be represented as something like 5-50mm. In general, a higher optical zoom means a larger lens and a heavier camera. The Fujifilm J20 shown above offers 3x optical zoom. You might like to go for a higher-power zoom if you are planning on going on safari, etc. Avoid digital zoom.

Batteries and chargers

So far we’ve talked about image quality but there is a lot more to consider. Most cameras now come with lithium-ion battery packs, rather than AA batteries. This means longer battery life but also that it’s harder to get new batteries if you run out of juice on the move.

An important factor is how the batteries are recharged. Do they come out of the camera and go into a charger, or do you have to plug the camera into a charger? If you have to plug the camera in to charge the battery, you can’t also use it at the same time.

For most people it’s best to buy at least two batteries so you can be charging one in the charger while using another at the same time. If you carry spare batteries with you, you can easily swap when you run out.

Check that your battery charger can work overseas. Most can, and are marked with 110~240V. You might need a different cable or adapter, though. Amazon is probably a good place to look for alternative cables for your camera battery charger.

Memory cards

Memory cards are cheap now, so you might as well find out the largest size your camera can take, and buy that size. As a rule of thumb, most modern compacts take photos in JPEG format that are around 3-4 MB in size. You could save around 1000 photos on a 4 GB card.

Most importantly, buy two cards. If you haven’t the budget, it’s better to buy two small ones than one large one. If you are going on holiday, swap the cards over every day. That way if one breaks, or you lose one, you still lose half the photos but you lose every other day, rather than the first or second half of the holiday, or worse – all of them.

Always keep the cards in their little plastic cases to keep them clean. Consider keeping them in your wallet’s coin pouch so you don’t lose them.

If you run out of space, almost all tourist places sell memory cards these days, so you can easily buy another card and avoid deleting any photos.

Other features

Some cameras have other features that you may or may not want. Decide which you want in advance, and don’t let shop salesmen try to change your mind. Consider:

  • Movies. Almost all cameras can record video now, but some do it in poor quality as a secondary feature, or limited to 1 minute. If you want to use your camera as a camcorder, pick one that does video properly.
  • Panorama feature
  • GPS geotagging (records where each photo was taken – can be useful on a tour)
  • Image stabilisation (useful when you usually use full zoom)

Choosing the camera

It’s quite important to see the camera in real life before buying it. Some cameras feel right; others don’t. Some cameras have buttons that seem to be in awkward places.

Seeing the camera in a shop also gives you the opportunity to examine the build quality. Sure, it might tick all the boxes on your wish list, but if it’s plasticky and creaks when you squeeze it then it probably won’t last ten minutes in your pocket. It’s good to look for cameras with metal casing, and a sturdy lens cover. Some cameras have flimsy plastic lens covers that can easily be pushed open in a handbag.

Remember that it’s a bit rude to use a shop to play with a camera, and then buy online. You owe it to the shop to buy from them, but it’s a good idea to print out quotes from online retailers to show to the shop, and use to get a discount. Buying from a real shop gives you somewhere to return the camera easily if it isn’t quite what you were hoping for. Shops will often also do you a deal on a bundle – perhaps a camera, bag, memory card and second battery.

Building an email server using ClearOS

I’ve had a server at home for years now, and I’ve also been a professional sysadmin for at least three years. I know my way around Linux pretty well and for some time I’ve run my own web server and also other services.

But one thing I’ve steered clear of until now is running my own email server.

I’ve always thought it would be fairly easy to set up, but much harder to make secure. I don’t want to receive tonnes of spam and I don’t want spammers using my SMTP server as an open relay. In the past I’ve read about building SMTP servers with sendmail, postfix and exim but there was all sorts of conflicting information when it came to integrating milters and so on. Different guides all seemed to give contradictory advice and require all sorts of strange configuration steps that I couldn’t understand.

But all that changed when I heard about ClearOS. In short, it’s a spin of CentOS which uses a custom web interface to configure various software “modules”, including things like web server, email server, firewall gateway, database server, and so on.

I installed it on a virtual machine and after only a few clicks I was running a mail server: an MX for receiving mail for my domains, an authenticated SMTP server for personal outgoing mail, and a secure IMAP server for storing and accessing my mail. The frontend sets up postfix and cyrus to do its dirty work.

For ultimate ease, users (just me, in this case) are authenticated using a local LDAP directory, rather than by using system accounts. All SSL certificates for IMAPS and HTTPS were added automatically. Email antivirus scanning is done by Amavis and spam filtering is done by Spamassassin.

I had a little bit of trouble setting up Horde to access webmail and a web interface for configuring sieve rules. By “trouble” I mean the default Apache virtual host declarations needed some changing around and some aliases adding. If you’re familiar with Apache this won’t be a problem.

There are some aspects of ClearOS I don’t like so much, and I would prefer to use CentOS. But now ClearOS has written out all my configs it should be trivial to move my new mail setup to a plain old CentOS installation, where I already run my websites from. I have definitely learnt a lot about how email works by simply reading and understanding the config files written by the frontend.

So if you want to build an email server but don’t know where to start – try ClearOS. It’s a great introduction to the “scary” parts of setting up an email server, like milters and certificates.

Converting 120 film to 620

Recently I was lent a Kodak Six-20 Brownie box camera. Rather than the 120 medium format film I’ve used in the past, it takes 620 film.

The film stock is identical; only the spools differ. The 620 spool has a thinner axle, the end caps have a smaller diameter by about 2mm, and  the overall length of the entire spool is about 2mm shorter.

Original 120, 620 and modern 120 film spools with modern 120 film

120 film is still readily available but 620 film is very hard to find. There are two options:

  • Buy some empty 620 spools, and respool the 120 film in a darkroom
  • Modify the 120 spool of each new film by filing it down

I find roll film quite frustrating to work with in a darkroom and I didn’t fancy respooling it unless there was no other choice. So I decided to have a go at butchering a roll of 120. Even if it went wrong, I’d only have ruined £4 of film.

With the film still on the roll as new, I filed down the fatness of the end caps and then filed down their diameter. Fortunately I had one empty 620 spool to use as a template for my hack. It took only about ten minutes, but obviously filing away plastic left a lot of dust, so I had to make sure the film was extremely clean before putting it in the camera. I brushed it, and sprayed it with a can of compressed air.

The film now fits nicely into the Brownie, and I look forward to shooting with it. :)

Calibrating the focus ring on a Paxette

Recently I was given a Braun Paxette. After running a couple of rolls of film through it, I’ve decided that the focus isn’t quite calibrated correctly according to the focus ring.

Fortunately, you can loosen three grub screws around the snout of the lens and rotate the focus ring without moving the lens, line it up properly, and tighten it up again.

To calibrate the focus, you will need:

  • a bright and high-contrast object a known distance from the camera
  • some tracing paper or other diffuse translucent material

And here’s how we do it.

  1. Set up the camera on a tripod with the back open/removed. Attach the tracing paper where the film would usually go, like so:

    Calibrating a Paxette

  2. Put your bright object a known distance from the camera, and measure it. Call this distance X. If working indoors, try using something like a desk lamp or a TV screen (both are bright, with strong edges). If working outdoors, you could use a building with strong features (and pace out the distance from your camera).
  3. You might need to cast a shadow over the paper to see your image, but it should be there, albeit upside down.
  4. Focus the image so it is sharp. It can be hard to tell if the image is sharp, so you could use a magnifying glass to inspect it.
  5. When you’re happy that the image is in focus, you know that whatever your focus is set to now is X. Loosen the focus ring, readjust to that value, and tighten.

You’re done! Happy shooting.

Newbie's guide for Linux Apache web servers

Today a friend (from a Windows background – still a friend?! :P ) asked me how to go about setting up a LAMP (Linux, Apache, MySQL & PHP) server. I wrote him a few notes, not only on how to configure the LAMP stack, but also on how to configure a Linux system properly from scratch, and how to do so securely. There are millions of guides out there that explain how to serve web pages with Apache, but not many of them explain the basics of setting up a secure system too.

I’ve edited these notes slightly to make them suitable for a wider audience, but in essence it’s the same stuff. Hope it’s useful!

OS installation

I recommend using CentOS. It doesn’t really matter whether you choose 32-bit (i386) or 64-bit (x86_64) but use ideally use 64-bit unless there’s a reason not to.

Boot from the CD or DVD of your choice. It doesn’t matter whether you use the full DVD, or the network install CD.

Choose the text-based installer from the boot prompt by typing linux text. The text installer doesn’t install as much extra rubbish as the GUI installer.

In most cases the default options are good enough. One option you should change is to use an NTP time server. This is especially important with virtual machines, since they suffer badly from clock drift.

Choose a strong root password. You will only need it once again. After that, you won’t even even need it for logging on, so there is no need to pick anything memorable. In fact, you are best off choosing a long, random string of mixed-case letters and numbers.

When it comes to choosing packages, deselect as many of the groups as possible. We will add the packages we need individually later on.

Let the installer run its course, and reboot.

Users and passwords

Upon first boot, log in as root using the password you picked before. Now create new user accounts and set passwords:

useradd yourusername
passwd yourusername

Now for setting sudo access. This is like “run as admin” on Windows. Type visudo. In the text file that opens, read down to the line that says

root    ALL=(ALL)       ALL

Duplicate it twice by pressing yyp. Go into insert mode by pressing i and change the username root to your username. When you are done, hit Esc and type :wq to save and exit. Gotta love vi commands ;)

To disable remote root login via ssh, edit the file /etc/ssh/sshd_config using your favourite editor. If you don’t already have a favourite editor, use vi.

Find the line:

#PermitRootLogin yes

and uncomment it and change the value to no:

PermitRootLogin no

Restart the ssh daemon by doing

sudo /sbin/service sshd restart

From now on you can gain root access by using the sudo command, and you won’t need to log in as root again. Log out now by typing exit and re-login as your own user. Forget the root password forever.

Installing packages

First we add a couple of third-party software repositories that have useful stuff.

sudo rpm -Uvh http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm

Let’s get rid of the stuff we don’t want or need. There are no doubt more than things that can be removed than I’ve listed here, but they can be removed later.

sudo yum remove bluez* pcsc*

Update the system so you’re sure that that latest versions of all software are installed.

sudo yum update

Now we can install the stuff we want for LAMP!

sudo yum install httpd mysql-server php php-mysql

If you are wanting to use any PHP modules/libraries they can be installed here too, such as the commonly-used graphics library gd.

Services

Let’s start the two daemons for Apache and MySQL, and tell them to start on boot.

sudo /sbin/service httpd start
sudo /sbin/service mysqld start
sudo /sbin/chkconfig httpd on
sudo /sbin/chkconfig mysqld on

Apache in its default state will run out of the box. MySQL just needs a root password setting.

mysqladmin -u root password NEWPASSWORD

From now on it’s advisable to GRANT access to specific users on specific databases/tables. Go read about MySQL users.

Firewall

Let’s assume you want HTTP on port 80 open to the world. Open /etc/sysconfig/iptables for editing, and add this line.

-A RH-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

Save and close, and run this to make the changes live.

sudo /sbin/service iptables restart

Editing configs

The main config file for Apache is at /etc/httpd/conf/httpd.conf. It doesn’t need any changes for basic operation, but if you edit it you need to restart the httpd service to pick up the changes.

If you get serious with web publishing from a LAMP platform, you will probably want to read about name-based virtual hosts.

Adding content

In its basic configuration, you should add PHP scripts, HTML pages and other content like images and stylesheets to /var/www/html/. You do not need to restart the daemon for it to pick up new content.

When debugging pages, you will probably find it handy to refer to the error log, at /var/log/httpd/error_log.

Tip: Open two SSH windows to the server – one for editing stuff, and the other for watching the log scroll by as events occur. Use Ctrl-C to break out of it. Do this:

sudo tail -f /var/log/httpd/error_log

Tilt-shift miniature fakes in GIMP

As posted on my photo blog yesterday, I faked a tilt-shift miniature model of the A4 in the Avon Gorge.

I’d never tried it before, so I followed this guide on how to do it. It was pretty straight forward, but I’ve recreated the steps here, with my own modifications.

Step 0: Take a photo

Start off by taking a photo to make into a fake miniature. The best photos are taken looking down on your subject, as a human observer would see a model on a table, for example. Include subjects such as people or cars to give a sense of “scale”.

Strong shadows also lend themselves to the effect, as you may well look at a model railway using a single desk lamp, for example.

Step 1: Adjust colours

Most models have more vivid colours than real life, due to their glossy paint. There are several ways you could achieve this.

  • Go to Layer > Colors > Curves. Click at about x: 130 y: 210. Move the curve around until you get what you are looking for.
  • Or, go to Colors > Auto > Color Enhance. This is the lazy man’s way of boosting the saturation.

You might also like to enhance the contrast to make the shadows stronger.

Step 2: Set gradient mask

Open the image and toggle the switch mask on. There are three ways to do this:

  • Click the dotted box in the bottom left had corner of the open image, or
  • Got to Select > Toggle Quick Mask, or
  • Press Shift+Q.

The image will now be pink. Click on the Gradient tool. It looks like a square with a grey gradient applied to it. Set the gradient shape to Bi-linear.

Step 3: Apply mask

Pick your focal point. Decide what areas of the image you would like to be in or out of focus. Click in the center of the area you would like to be in focus and drag a line perpendicular to the direction you want to be masked, i.e. dragging the line from the “in focus” region to the “out of focus” region.

Play around with the centre, size, and angle of the mask until you get what you are looking for. Toggle the switch mask off.

Step 4: Apply blur

GIMP doesn’t have Lens Blur like Photoshop (although it can be installed). We have to make do with Gaussian Blur. Go to Filters > Blur > Gaussian Blur. In the Gaussian Blur window click on Preview and maximize the window so that you can see what you are doing.

Play with the blur radius until it looks right. A Blur radius between 5.0 and 10.0 seems to work most of the time, although I found a radius of 50.0 was needed to achieve a decent effect in my image. It depends on the resolution of your camera.

When you have the blur right, delete the quick mask by going to Select > All.

Getting information about your video files

The other day, I wanted to find out which of the videos in my movie collection were encoded with multitrack (e.g. 5.1) sound.

I found a tool for Linux called themonospot. Happily, it’s packaged with Fedora and can be installed simply by doing

yum install themonospot-console

Once installed it’ll quickly give you information about your video files:

[jonathan@zeus ~]$ themonospot-console /media/public/Movies/Sunshine/Sunshine.avi
File path:               /media/public/Movies/Sunshine/Sunshine.avi
Codec name:              XVID
Codec desc:              xvid
Frame size:              704 x 288
Average video bitrate:   1,423 Kb/Sec
File size:               1,525,886 KB
Total time:              01:47:26.00 seconds
Frame rate:              24.00 frames/sec
Total frames:            154,574
Video data rate:         23 frames/sec
Video quality:           113
Packet Bitstream:        False
ISFT data:               VirtualDubMod 1.5.10.2 (build 2540/release)
JUNK data:               VirtualDubMod build 2540/release
USER data:               XviD0046
Audio 01:                0x2000 (AC3) 448.00 Kb/Sec - 48000 Hz (6 Channels)

As you can see, my copy of Sunshine has 6-channel audio (i.e. 5.1). But what if you want to run a batch job to check all of your films and see which ones have surround sound?

Then use perl.

I wrote an extremely hacky script that takes a path as an argument and whizzes round to fetch the encoding of all .avi or .AVI files in the directory. It prints the names of any that have more than 2 audio channels (i.e. better than stereo).

It sometimes goes wrong if the output of themonospot-console varies, as it occasionally does.

So you get output like this…

[jonathan@zeus ~]$ ./findAudioEncoding.pl /media/public/Movies/
/media/public/Movies/Catch Me If You Can/Catch Me If You Can.avi : 6
/media/public/Movies/National Treasure - Book of Secrets/National Treasure - Book of Secrets.avi : 6
/media/public/Movies/Never Been Kissed/Never Been Kissed.avi : 6
/media/public/Movies/Rescuers, The/Rescuers, The.avi : 5
Argument "" isn't numeric in numeric gt (>) at ./findAudioEncoding.pl line 12.
/media/public/Movies/Brideshead Revisited/Brideshead Revisited.avi : 5
/media/public/Movies/Passion of the Christ, The/Passion of the Christ, The.avi : 6

If you’re interested in the source, here it is. If you find this useful, why not “like” my post? (The at the bottom)

#!/usr/bin/perl -w
# findAudioEncoding.pl

use strict;
my $path = $ARGV[0];
chomp (my @files = `find $path 2> /dev/null | grep -i .avi`);
foreach my $file (@files) {
        chomp (my $channels = `themonospot-console "$file" | grep \"Audio 01\" | awk \' { print \$10 } \'`);
        $channels =~ s/\(//g;
        if ($channels > 2) {
                print "$file : $channels\n";
        }
}