Archive

Posts Tagged ‘GIMP’

Tilt-shift miniature fakes in GIMP

May 3rd, 2010 No comments

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.

Categories: Guides, Linux, Photography Tags: , , , ,

Batch conversion of images on Linux

June 27th, 2009 No comments

I recently had a need to convert 3,000 scanned TIFF images to a more sensible format for distribution, such as JPEG. I’ve been using GIMP to edit the individual photos but sadly it doesn’t have a batch format conversion tool.

So I wrote my own little script in bash. You will need to install ImageMagick (a commandline image editor) on your box first, but this is bundled with most distributions and be installed from a repository.

Things to be aware of when using this script:

  • It does not recurse into subdirectories – you have to place the script in the same directory that the TIFFs are in
  • At the time of writing, ImageMagick is single-threaded and can only use one core of a multicore CPU. If you want to use N cores, you have to split the photos into N directories and run N copies of the script. However be aware that, in my case at least, each TIFF was around 45MB and took between 1 and 1.5 seconds to convert. This means the disk is reading at maybe 40MB/s, so running two threads you will quickly hit the limit of your disk.
  • You can change the compression of the JPG by altering the value 85 in the script below.
  • You can also convert your TIFFs to other formats. See man convert for details.

Finally, the code you’ve all been waiting for. Feel free to use, edit, distribute this anywhere you please.

#!/bin/bash

total=`ls *.tif | wc -l`
count=0
ls *.tif | while read i
do
file=`basename "$i" .tif`
echo $file
convert "$file.tif" -quality 85 "$file.jpg"
count=`expr $count + 1`
percent=$(($count / $total))
echo $percent% completed, done $count of $total
done
echo All done!