1 AUTHOR: Ken Moffat - ken@linuxfromscratch.org
5 LICENSE: Creative Commons Attribution-Share Alike 4.0 International
6 (CC-BY-SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
8 SYNOPSIS: Using raw photos to get a wider range of highlight and shadow
9 detail, in a manner somewhat similar to creating HDR photos, but with
10 8-bit (jpeg) results, and using a comparatively-simple approach.
12 DESCRIPTION: This guide provides suggestions for using raw photos in the
13 gimp (2.8) with ufraw so that on-screen jpegs can show more detail, but
14 without the intricacies of hand-painting masks. The techniques were
15 tested with pictures of trains, where much detail is often hidden in
16 deep shadow, but may be useful to people who photograph scenery,
17 buildings, and other similar subjects, or (untested) for photos of
18 people in bright sunshine. The approach here is comparatively quick per
19 photo - real photographers can afford to spend a couple of hours on a
20 picture, but when I have maybe 50 pictures per day, all of which I want
21 to try to put online, and a couple of weeks' worth of pictures, such an
22 approach is not going to work for me.
24 LANGUAGE: This hint and the menu settings to which it refers use British
25 English (en_GB), some of the menu spellings might differ in en_US.
31 A camera which takes raw images in a format usable by ufraw
32 [ http://ufraw.sourceforge.net/Cameras.html ]. The ufraw website is
33 rather old, I suspect many other cameras are supported, for example my
34 Panasonic DMC-FZ45 is supported but not listed. For convenience, it is
35 easiest if your camera can save both raw and jpeg images - the jpegs
36 will give a first view of what you recorded once you upload them to a
37 computer and also, at least in my case, provide a more usable subset of
38 EXIF data. Please note that although ufraw is based on Dave Coffin's
39 dcraw, it is a rewrite to C++ and therefore released versions will lag
40 behind new dcraw changes for the very latest cameras.
42 Unlike "true" HDR photography (multiple exposures, the camera has to be
43 on a tripod with constant aperture and focus), the approach here uses
44 *one* image, but applies different exposure values (EV) to it in ufraw,
45 e.g. 0.00 for what the camera decided was correct, +1.00 (an extra stop)
46 for a little more shadow detail, -1.00 for highlights. Some people call
47 this 'Pseudo HDR', others 'Simulated HDR'.
49 With a good camera, using large amounts of additional ExposureValues to
50 extract detail from dark parts of the picture is not a problem and a
51 range of ±2EV on whatever looks like the correct midpoint (often the
52 same as the camera's 0EV, but occasionally a half or a full stop more or
53 less) will work well. But with a less-good camera, such as my FZ45,
54 starting with a fast "film speed" such as iso400, and then adding two
55 stops (iso1600) or more shows a lot of noise.
57 For that camera, I have a prefrence for using narrower ranges of EV but
58 from time to time I need to use more - in those cases, a smaller final
59 image (e.g. 1600x1200) tends to make the noise less obvious.
61 In other cases, there is little tonal range, and using ±1EV will get
62 everything that is on offer. But for views, it is best to zoom-in the
63 picture in ufraw to make sure that no shadow detail is inadvertently
67 (ii). Monitor settings and adjustment
69 Your monitor needs to be adjusted to maximise the range of grey shades
70 it can display. Some people seem to turn up their monitors to maximum:
71 apart from hurting your eyes, that is somewhat useless for photo
72 editing (the "goes up to 11" approach).
74 If your monitor gives you the option, set it to sRGB. Then, follow the
76 http://www.cambridgeincolour.com/tutorials/monitor-calibration.htm
78 After that, confirm the setting by reviewing what you see at
79 http://www.northlight-images.co.uk/viewing.html
81 My main monitor is a Sharp 20" TFT, using manual Gain Control with both
82 Black Level and Contrast set to 60 (and using the VGA input). If you do
83 not have any available controls, and your monitor is too bright (hello,
84 AOC) you can use xrandr to reduce the brightness. For example I had set
85 my AOC monitor to 75% brightness with xrandr to avoid hurting my eyes,
86 but for testing this hint I increased the available tone range by
87 reducing the brightness a little more in ~/.xinitrc :
89 xrandr --output VGA-0 --brightness 0.66
91 I am not using any colour-correction because my attempts to try the
92 various available icc profiles (mostly from colord) using xcalib [ from
93 xcalib.sourceforge.net ] did not show any noticeable differences,
94 except for three profiles that were clearly not correct for my monitor.
95 If I ever had a CD for this monitor, I guess I lost it. If I was going
96 to make a lot of prints, it would be worth getting my screen calibrated
97 (people speak well of Argyll, with a suitable measuring device) and then
98 getting a custom icc profile for my printer and paper - I might do that
99 latter part, apparently you need to use the 'Uncorrected' setting in
100 'Print with Gutenprint' both when printing the test chart, and when
103 (iii). A sheet of notepaper with a straight edge.
105 This is not part of the process, but when I use a wide lens at its
106 widest focal length I usually see barrel distortion (except on one
107 really good lens, which is enormous and weighs a tonne). For (some)
108 buildings, and for trains, this often looks atrocious. Interestingly,
109 once I notice it, I can often see it in the camera's own jpegs, and of
110 course I see similar distortions daily in TV news programs and
111 documentaries, so I guess that many people no longer care. The edge of
112 the paper can be held against the screen to see if the correction I am
113 trying is helping things or making them worse. On my FZ45, at some focal
114 lengths I even see pincushion distortion.
116 CHANGELOG: 2016/01/02
117 · Initial version, for comments
122 I got a camera with the ability to take raw images in the early 2000s.
123 At that time I found ufraw, and used that to adjust some pictures. In
124 late 2007 I renewed my interest in trains, and model railways, and
125 started visiting various lines and taking pictures that I hoped might be
126 useful to other modellers. In the days of real film you could get hand
127 prints, for a price, with improved detail - the Dodge and Burn tools in
128 the gimp replicate this approach, but are not easy for a novice to use.
130 At this time, I was mostly using the curves tools, both in ufraw (a
131 series of Base Curves I created over the years - some were very weird
132 shapes) and the curves tool in the gimp to do final adjustments. I was
133 often concentrating my efforts on extracting the maximum detail (e.g.
134 in the bogies and equipment beneath a railway vehicle), and I suspect
135 that from time to time the colours suffered.
137 That process always seemed haphazard, although on a good day I could fix
138 up two or three photos per hour. I had become aware of people creating
139 HDR photos, but I tend to file most of those I see under "everything
140 overdone". Last year I attempted to get back to preparing photos (I've
141 got a large backlog, my old process was *really* not working on some
142 pics from my Panasonic) and seeing if I could find any more-reliable way
143 to do things. I explored gegl and 16-bit colour, but that did not help
144 my problems. I also looked again at using layers and trying to blend
145 multiple exposures, but at that time I failed to get reliable results.
147 A couple of months ago I resumed this approach, and found some other
148 links which guided me into what I am now doing. In general, people using
149 HDR techniques seem to be good at painting masks - I am not, and I
150 needed something simpler that I could just "apply, see if it works".
152 My initial attempts seemed to mostly work, but I was not confident of
153 the process and I made several mistakes. Eventually, I took one set of
154 pictures where I had not yet attempted to do anything and where some of
155 the pics came from my Olympus (generally fair quality) and the rest from
156 my Panasonic (often lower quality, more red noise as I increase the EV,
157 variable lens distortions). Those pics are from the Zillertalbahn, both
158 the stock and stations, and also general views. I worked through them
159 and eventually got them online
160 [ https://www.flickr.com/photos/61907329@N03/albums/72157659289411903 ]
162 After that, I took a selection of other photos and worked to finesse the
163 process. The only pics which actually use my current approach are not
164 very good (using the Panasonic at iso400 showed up its limitations), but
165 they are probably as good as I'm going to get:
166 [ https://www.flickr.com/photos/61907329@N03/albums/72157662818676856 ]
171 The main drawback is that this approach reduces the contrast. After
172 finishing my first set of pictures, I explored alternative approaches.
173 The only thing which reliably improved the result was to increase the
174 contrast - but at the expense of losing some of the hard-won shadow
177 In one picture (a red train mostly in shadow, everything else in full
178 sun) the red came out a bit magenta-ish or blueish. I eventually got an
179 adequate result by increasing the base exposure a little more and
180 sacrificing one highlight (a white cloud). So, this is not a panacea,
181 and for some photos I have ended up spending a long time trying
184 If the EV needs to be boosted, particularly at high ISO numbers ("film
185 speeds"), the amount of sensor noise can become obtrusive, at least on
188 The biggest drawback is that, as with my previous approach, when things
189 are going well I can still only do 2 or 3 pictures per hour, and often
190 fewer, but at least the process is now more repeatable.
195 The gimp (2.8.16) is in BLFS (I initially tested with 2.8.14 from BLFS
196 7.8, for this hint either version is fine) - I assume that the libexif
197 dependency is needed to write some EXIF data (that functionality is new
198 in recent versions of gimp-2.8, and will cause you surprise if you did
199 not know it was present). There are two necessary additions, one plugin
200 (Advanced Tone Mapping) and the ufraw package. So, after the gimp has
201 been installed, first get the plugin from
202 http://registry.gimp.org/node/5980
203 (open in a browser, download the attachment and read the notes and
204 follow the link to the blog post).
207 install -v -m644 /path/to/advancedtonemapping.scm \
208 /usr/share/gimp/2.0/scripts [ yes, 2.0 not 2.8 ]
210 For me ufraw-0.22 is just a straight ./configure --prefix=/usr
211 followed by make, and then as root make install.
213 This uses, and probably requires, jpeg(-turbo), libtiff, and libpng. It
214 also needs exiv2 to read the EXIF (and XMP) Metadata. It can apparently
215 use libjasper (I do not build that). All of those are in the BLFS book.
217 I do not provide the deps for CFITSIO and LENSFUN : lensfun is a
218 database of lens variations, I tried it when ufraw could first use it,
219 but did not see any benefit on what I was doing at that time. I thought
220 it had become non-free (as in 'paid for'), but I see it is currently at
221 https://sourceforge.net/projects/lensfun/ and uses cmake. Perhaps it is
222 useful to correct lens abberations, if your lens has been reliably
223 measured. I know nothing about CFITSIO (according to wikipedia it is for
224 processinging astronomical science data), but it is at
225 http://heasarc.gsfc.nasa.gov/fitsio/ if you have any need for it.
227 There are a number of configure options in ufraw, but I do not need to
228 use any of them - please check them in case they apply to your camera.
233 At last, the rules of thumb I use for processing the pictures!
235 1. Configuring the gimp to support this process.
237 1.1 In the gimp, ensure that the Layers dialog is visible. If it is not,
238 go to Windows -> Dockable Dialogues and click on Layers.
240 1.2 Remember that you can always undo, and for filters you can undo/redo
241 if you were not sure about the effect and wanted to see it happen again,
242 or more usually (trying different settings) undo/reshow [ that will
243 leave the values as you last used them, you can then adjust them ]. The
244 default undo settings are too restrictive for this process (you probably
245 never need to be able to go all the way back, but allowing that can be
246 useful). The default seems to be 5 levels of undo, and since add new
247 layer, paste, anchor, duplicate, desaturate, invert, select all, add
248 layer mask, paste, anchor, delete layer each count as one level, 5 is
249 woefully inadequate. For what I am doing, 25 levels might be enough, but
250 30 seems safer. Unfortunately, the undo history is never saved. So,
251 whenever you are making a *series* of changes which might need to *all*
252 be backed out (rotate/perspective/crop) or Contrast with Advanced Tone
253 Mapping (below), it is best to save the xcf file before you start the
254 series of changes, and then not save it again until the series is
255 completed and you are happy that it is ok. Some of the gimp's settings
256 need to be changed to allow more undo levels, and you might also want to
257 display the Undo History dialogue (Windows -> Dockable Dialogues -> Undo
258 History). To change the settings for Undo, go to Edit -> Preferences ->
261 1.3.1 increase the Minimal number of undo levels to 25 or 30
263 1.3.2 for Maximum undo memory, mine defaulted to 64MB. I found a
264 suggestion that 2 or 3 GB might be needed, and another that using 3GB
265 slowed a machine (probably 32-bit) to a crawl. I have at least 3.9GB of
266 RAM on my machines, so for the moment I have set this to 512MB and it
267 seems to be sufficient - my largest pictures are only 4336x3258 pix. I
268 guess larger images might need more undo memory.
270 1.3.3 The Tile cache size defaults to half the available RAM, but with a
271 size measured in KB. I see no reason to change this on my machines.
273 1.3.4 The Maximum new image size on this machine was 128MB, there is no
274 need to change this - if you try to create a bigger image, it will ask
275 if you wish to do that.
277 1.3.5 In Preferences -> Folders, the default Temporary folder is /tmp,
278 but the Swap folder is ~/.gimp-2.8 : in practice, this is where
279 everything seems to be stored. My images are all in ~/ so that seemed
280 fine, except on my test machine where /home is woefully tiny: for that,
281 changing the swap folder to live in /tmp worked well.
283 2. Configuring ufraw : from within the gimp, open a raw file. You will
284 see a lot of options at the left:
286 2.1 The exposure EV is the most obvious (you can overtype in the box to
287 set a value, or delete everything to restore to 0.00)
289 2.2 next to this is an icon to change how details are restored for
290 negative EV - I use the upright lightbulb setting to restore in LCH
291 space for soft details
293 2.3 then there is an icon for how highlights should be clipped in
294 positive EV space - I use what the tooltip describes as 'soft film like'
295 but I cannot say what the icons are supposed to represent ;)
297 2.4 Next to this are icons to auto-adjust the exposure (never useful,
298 IMHO) and to reset it to the default.
300 Below these are icons for:
302 2.5 white balance (I usually use the camera's) : if you ever need to
303 change this, e.g. for indoor shots, remember to use the same setting on
304 all three exposures, then go back to the camera's own white balance for
307 2.6 greyscale mode (not relevant)
309 2.7 curve - set this to linear, i.e. a straight line from bottom left to
312 2.8 profile - I have no profiles, so I set the Input ICC Profile to No
313 Profile, without a profile I use the default Gamma and Linearity, Output
314 Profile sRGB, Output Intent set to Perceptual, Output bit depth 8 (jpegs
315 are only 8 bit, although you can create pngs or tiffs as 16-bit if you
316 wish - camera raw files typically have 12 or 14 bits of actual data),
317 Display Profile set to System Default, Display intent set to Perceptual
318 NB if you use 16-bit, the gimp's xcf files will be bigger!
320 2.9 Saturation - use a Linear Curve
322 2.10 Lightness Adjustments - no idea, this just shows an eyedropper
324 2.11 Crop and Rotate - ignore
326 2.12 EXIF data summary, as read by exiv2. This is useful to help decide
327 what, if any, lens correction is likely to be needed.
329 2.13 You will also need to be able to identify overexposed areas (i.e.
330 those parts which eventually become burned out): Open a raw image. Under
331 the histogram, right at the bottom, are two check boxes to identify
332 overexposed and underexposed areas. Check the box for overexposed
333 areas (only) - they will start to flash. If nothing is flashing,
334 increase the exposure adjustment (EV) until you see what happens. For
335 underexposed areas, I rely on my judgement.
337 3. Begin the process: open the image at three different EV settings.
339 In the gimp, open the raw photo you wish to work on. This will open the
340 ufraw plugin. You may wish to make a note of the EXIF data for focal
341 length and aperture. On a good camera, any lens distortion should be
342 consistent for a given focal length and aperture. With enough pictures,
343 it is therefore possible to keep notes and determine the expected
346 3.1 Begin by deciding what is a mid-tone in the shot, and adjust the EV
347 until that part looks correct. In many, but not all, shots the camera's
348 own idea of the EV (0.00) will be correct. Conversely, when trying this
349 technique on some pics from an older camera (Olympus E500) I found that
350 in most cases it appeared to underexpose by a half or a whole stop. So,
351 know your camera! Usually I begin by moving in ±0.5EV steps to see how
352 things change, but sometimes I end up trying ±0.25EV changes. In general
353 I cannot say that any particular exposure is "right", only that it seems
356 3.2 You now have the "base" exposure. Before you open that, work out
357 what range of exposures you want to use, both to recover shadow detail,
358 and to ensure that the highlights are not blown out.
360 If there is very little detail in the shadows, perhaps +1.0EV (on top of
361 the base exposure) will suffice. In other cases, +2.0EV and occasionally
362 even more will give you more detail.
364 Then look at the highlights - the image in ufraw will "sparkle" or
365 "twinkle" for anything that the program considers is burned out. Mostly,
366 I find that a small reduction in exposure, often only -0.5EV, is
367 sufficient to stop that.
369 The problems are where the highlights need a larger reduction than the
370 increase for the shadows - in these cases, your base exposure might need
371 to be adjusted. Also, if the main subject is dark (e.g. a dark green
372 railway carriage) the final end result might appear too light, in which
373 case you will need to come back to this stage and try with different
374 values. In such cases, it may be better to make the base EV slightly
375 darker (underexposed) than you would otherwise use, and perhaps also to
376 restrict the range (e.g. ±1EV instead of ±2 EV) so that the final colour
377 is not too light. If the picture is underexposed, using a large range of
378 EV adjustments might make sensor noise (from the EV used for shadow
379 detail) too prominent - if that happens to you, see whether a different
380 base EV, and a smaller range, will help.
382 3.3 The critical thing, IMHO, is that the shadow and highlight EV
383 changes match, to avoid odd colour changes. So, if the shadows need +2.0
384 EV on top of the base exposure, I will use -2.0 EV off the base for the
387 3.4 In some shots, the raw image at the base EV has little or no
388 overexposure. Such shots may limit your ability to use wide EV ranges
389 because almost nothing will be taken from the highlights image. If that
390 happens, I suppose you could try a brighter highlights exposure (i.e.
391 not a central base exposure).
393 3.5 I have tried using layers copied from the *base* exposure to create
394 masks in some pictures, but I found the process much harder (keeping
395 track of the right layer) and not reliably better.
397 3.6 Always check your maths, particularly if you are not using 0EV as
398 your base. e.g. For a base exposure of +0.25 EV, and a range of three
399 stops (total), you need shots at +0.25EV, +1.75EV, and -1.25EV (±1.5
402 3.7 Now open the picture three times at the desired exposure variations.
403 I find it easiest to open the darkest (highlights), then the lightest
404 (shadow) and finally the base. For me, the gimp opens comparatively
405 small windows for each image, which is good for easily getting to any of
406 them, and also allows me to have one or two others open as well. To help
407 you understand the effect of the changes, you might wish to open a
408 second copy at the base exposure, so that you can later compare the
409 multi-layered version. If you do that, it is best to save the working
410 copy (filename.xcf, or filename-something.xcf) to prevent you from
411 accidentally saving the unaltered image over it [ doing that is probably
412 NOT undoable ]. You might also want to open the camera's own jpeg
413 (assuming you have one) for comparison.
415 3.8 I normally save my "working" copy as filename-fixups.xcf, this
416 contains all the steps *except* for the Unsharp Mask. I then create
417 filename-prepared.xcf, apply the Unsharp Mask, and then export a jpeg to
418 filename-90.jpg to review. The -90 is because I use the default 90%
419 compression, and avoids overwriting the camera's own filename.jpg.
421 If I make multiple attempts at a picture, the second will be
422 filename-fixups-A.xcf, then -B, etc.
424 3.9 Perhaps I need to mention here that the working files can be
425 somewhat large: on one sample photo from my panasonic [ 4320x3240 pixels
426 before cropping ] the camera's own jpeg is only 4.7M, but a multilayer
427 xcf file was 137M and the xcf files before and after sharpening were 47M
428 and 46M. My 90% jpg took 7.1M. To save space, I use bzip2 to compress
429 the xcf files after I'm done. The gimp can open the .bzip2 (or, indeed
430 .xz, but I find bzip2 quicker and the space difference is not major).
433 4. Add the shadows to the main image.
435 4.1 In the window containing the base image, go to Layers -> New Layer
436 and add a layer. I normally call my layers 'shadow' and 'highlights'. If
437 you forget to change the name, you can click on it in the Layers dialog
440 4.2 Now, go to the shadow image.
441 Select -> All and then Edit -> Paste
443 4.3 Go back to the base image, in the Layers dialog you should see that
444 you are in 'shadow'. Edit -> Paste : the Layers dialog will show a
445 Floating selection at the top. On the bottom of the Layers dialog, next
446 to the rightmost icon for delete (variously a red ring with a black x in
447 it, or a dustbin, depending on your icon theme) is a representation of a
448 ship's anchor. Click on that to anchor the paste.
450 4.4 You now have the shadow layer visible in the main image window, i.e.
451 the picture has all become lighter. The next step is to make a mask so
452 that some of this (the bright parts) will not be so bright. In the
453 Layers dialog, right-click on the shadow layer, and select 'Duplicate
454 Layer'. You should now have a layer called 'shadow copy' (temporarily,
455 3 layers). This is where you will need to take things on trust for a few
458 4.5 A layer mask is monochrome (black, white, shades of grey). Anything
459 within it which is white will be wholly visible, anything black will not
460 show at all. We begin by using Colurs -> Desaturate. There are options,
461 I use the first (Lightness), and you need to click on 'OK'. At this
462 point, you have a black and white photo, and because this is the most
463 exposed layer, a lot of it may be fairly pale. But what we need here are
466 Click on Colours -> Invert : what was dark should now be white or light
467 grey. Now Select -> All and Edit -> Copy to copy the mask.
469 4.6 Now go back to the Layers dialog. Right-click on the shadow layer
470 and Add Layer Mask. There are options, but I think for this process any
471 of them will do, so just 'Add'. The active (coloured) line in the Layers
472 tab should now be on the shadow layer, and it will now have an empty box
473 to the right of its first ('picture') box.
475 4.7 Go back to the main image window, the Layers dialog shows you are in
476 the shadow layer and you still have the inverted mask occupying the
477 window. Edit -> Paste. Go to the Layers dialog and anchor the floating
478 selection. Nothing seems to have changed, except that anchoring that
479 paste put something into that new box (the mask). Now click on the
480 shadow copy layer (top of the stack in the layers box) and then click on
481 the delete icon (at the right end of the icons) to delete it. You are
482 now back to 2 layers (initial, and shadow).
484 4.8 If this worked, the darker parts of the original image should now be
485 lighter, so with more detail, but any overexposed highlights will still
486 be blown, and the whole image may have become a bit lighter. If your
487 results are different, stop, see if you can work out what you did
488 wrongly, and if not work through Edit -> Undo until the problem is
491 4.9 At this point, you can go back to the overexposed image and Edit ->
492 Undo : if you undo 'Select All' you can now close that image without a
493 dialog asking if you wish to save the changes.
496 5. Add the highlights (much as before, but no inversion)
498 5.1 In the main image Layers -> New layer : I call it highlights.
500 5.2 In the dark image, Select -> All and Edit -> Copy
502 5.3 In the main image (the Layers dialog should show 3 layers, and you
503 should be in the top one, 'highlights') Edit -> Paste and then in the
504 Layers dialog click the anchor. The main image should now match the dark
505 image, i.e. most of it is too dark.
507 5.4 In the Layers dialog, right click on the highlights layer and select
508 Duplicate Layer so that you temporarily have 4 layers.
510 5.5 Go back to the main image window, the Layer dialog will now show you
511 are in 'highlights copy'. As for the shadows, use Colour -> Desaturate
512 and click 'OK'. This time, we want the highlights to appear white in the
513 mask, and that is how they will be, so do NOT invert the colours.
515 5.6 In the Layers dialog, right click on the highlights layer, select
516 Add Layer Mask, click on Add.
518 5.7 In the main image window, Edit -> Paste. In the Layers dialog,
519 Anchor the floating selection, then click on the top layer (the copy)
522 At this point, you should have three layers, with shadow detail and
523 highlight detail all present in the picture. But the contrast will have
526 You can also dispose of the underexposed shot that you used for the
527 highlights by undoing Select All and closing.
529 The process to this point used judgement to select the exposures, and
530 then a mechanical application of the steps to add and mask the layers.
531 >From here on, just as when you work on a single exposure, you are back
532 to using your judgement, so do not rush.
535 6. Corrections (this part is not specific to using multiple exposures)
537 >From here, you probably want to make the image window occupy most of
538 your screen - I normally have several terms open (notes on what I'm
539 doing, notes on typical distortion values to use with my lenses) and of
540 course the gimp provides various tabs. You may prefer to just maximize
543 At certain focal lengths, I need to mitigate the lens distortion. In
544 some pictures, I need to correct rotation (clockwise / anticlockwise)
545 and/or tilt because the camera was pointing up or down (perspective).
546 Attempting to correct any lens distortion needs to be done first, before
547 any attempt to straighten the picture. NB both rotation and perspective
548 can be done with the perspective tool, but I find it easier and quicker
549 to do them separately.
551 6.1 Click in Layers -> Merge Down, twice, so that your three layers are
552 reduced to one layer.
554 With some of the filters and tools (lens distortion, perspective,
555 rotate), if you try to use the tool when multiple layers are present the
556 preview will be in monochrome. For other filters such as the unsharp
557 mask, working on multiple layers will appear to work, but have less
558 effect than expected. So, always check that you have merged down all the
559 layers. If you try to use the Advanced Tone Mapping filter on multiple
560 layers, it will fail and corrupt the Undo history.
562 6.2 Now, if needed, do any lens correction
564 The filter is at Filters -> Distorts -> Lens Distortion. I only ever
565 change the top field (Main). If you can see barrel distortion, use a
566 negative number here (very specific to the individual camera / lens).
567 This is where the sheet of paper comes in, you can lay it on your screen
568 along any line which *ought* to be straight, and watch how the curvature
569 changes at different settings.
571 If you started with barrel distortion, a negative value in 'Main' will
572 push the corners of the image out, and you will still have pixels in the
573 full image area. But if you started with pincushion distortion (much
574 less common), a positive value in the Main field will push the corner
575 pixels in and you will no longer have anything in the corners of the
576 image, or perhaps at the edges. That will be addressed at 6.5 ('Crop').
580 >From time to time, I take a photo in a rush. Sometimes, the result is
581 useless, e.g. the subject wasn't in focus. Other times, it looks as if
582 it might be useful, but things are all at an angle. It can be hard to
583 distinguish rotation from perspective distortion in some pictures. I
584 usually find that separating Rotation and Perspective orrection makes
585 things easier, but YMMV.
587 Tools -> Transform Tools -> Rotate gives you a dialog where you can set
588 the angle, and a grid over the picture. In practice, what matters is the
589 central part of the image, around the cross marking. To check verticals
590 (and horizontals if present), I pull the dialog around so that I can use
591 its edges to review what I can see. To zoom into the picture, click on
592 the main image amd then '+' (as many times as necessary), or '-' to zoom
595 If the whole shot is rotated, enter the number of degrees (positive
596 rotates clockwise) on the dialog, then enter. I normally use multiples
597 of 0.5°, that seems to usually be close enough. And note that if you
598 have to rotate more than about 2°, a lot of the picture will be lost.
602 The archetypal problem for perspective distortion is converging
603 verticals on high buildings. Nowadays, my common problem is the
604 opposite - I tend to have the camera pointing very slightly down, so
605 that verticals at the edge of the picture spread out towards the edges
606 (walking with two sticks makes me look down). In either case, this can
607 be fixed with Tools -> Transform Tools -> Perspective. This tool can be
608 a bit fiddly to use [ you get numbers on a popup, but they are not
609 useful], and although I have tried pulling corners out (to spread the
610 pixels) there never seems to be enough screen space to do that. I find
611 the easiest way to fix the problem is to slide the corners of the grid
612 inwards (left-to right, NOT up or down) to correct the problem.
616 If your image no longer occupies the full image area, you will need to
617 crop it. Alternatively, you might anyway want to crop it, either to
618 exclude someting, or to just provide a different format (e.g. simulated
619 widescreen or 'letterbox' from a normal camera). I take four-thirds
620 photos, for these the ratio should be 1.333 for landscapes, or 0.75 for
621 portrait (vertical) images. For other aspect ratios, you will need to
622 work out the ratio for yourself. The bottom of the window SHOULD show
623 the ratio (but only to 2 decimal places) when the crop tool is in use.
624 But occasionally, it doesn't. If that happens to you, save the xcf
625 without cropping it, close the gimp, then open the gimp, open that xcf
626 file again and retry. To crop, click in one corner of the part you wish
627 to retain, then pull the mouse to the opposite corner, checking the
628 ratio. Move the edges of the crop inwards if necessary (e.g. to retain
631 When ready, check that you did not include an empty part of the image
632 (chequered background) within the crop, and then click within the crop.
635 7. Improving the picture.
637 There are now two or three things which you might wish to try.
639 7.1 If you feel a need to change what is in the picture, using either
640 the clone or heal tools, take a copy, work on that, and ideally save it
641 to different names at frequent intervals. Some people are naturals with
642 these tools, I'm not. I have tried to use the clone tool to paint over
643 burned out rivet heads on a light green shiny sunlit surface, and
644 eventually managed, but I found it easy to do too much - if I realised
645 immediately, I could undo, but if I did not notice until a minute or two
646 later the bad change was too long ago to undo.
648 7.2 The first general improvement is to increase the contrast using the
649 bottom slider in Colours -> Brightness-Contrast (range -127 to +127). In
650 particular, this can sometimes make colours look more realistic. The
651 problem is that increasing the contrast can lose all the hard-won shadow
652 detail. At the moment, I am usually increasing the contrast to between
653 13 and 25, or occasionally 39. For the Zillertalbahn picture mentioned
654 above, I did not do this. But do NOT save the file here, in case the
655 gimp crashes before the next step and you cannot undo it.
657 Alternatively, if you are experienced in using the levels tool, I guess
658 you can adjust the values in that. When I first began working on single
659 exposures, I saw many recommendations to use the Levels tool : sure, it
660 gave very bold high-contrast images but the results were not what I was
661 looking for, so I now avoid it.
663 7.3 The other improvement is the Advanced Tone Mapping plugin ('ATM').
664 The version installed above works with gimp-2.8 (I previously found an
665 older original version that did not). It can be found at Filters ->
666 Enhance -> Advanced Tone Mapping. In many cases, the effect seems to be
667 minimal, but in some it definitely helps make the picture look more
668 alive. In general, it also reduces the contrast a bit.
670 There is a dialog for altering the settings (see the blog entry linked
671 from the gimp registry for more details of why to do this) but I always
672 leave it set to the defaults. Using this adds a new layer, so you should
673 merge down afterwards [ if you don't, things like the unsharp mask still
674 seem to work, but perhaps not as well as they ought to ]. Again, if you
675 try this filter on an image with multiple layers, it will break the undo
678 If you are using both added Contrast and Advanced Tone Mapping, it might
679 need several attempts to find a good combination: set the Contrast,
680 perhaps a little more than you think is right, then do the ATM. If too
681 much shadow is lost, undo both steps and try again with different
682 Contrast. Similarly, try with more contrast if it is too light after
683 doing this. In a few cases, avoiding the ATM filter has seemed the best
684 bet, but for the moment I do not have a theory for when to use it ot not
687 7.4 When I started out with single images, I used to use the Curves tool
688 to get more detail out of some pictures, particularly underframe or
689 chassis detail on trains. With my current approach I had hoped to avoid
690 having to do that, but in a few photos it might still be useful. If
691 needed, I suppose this ought to be done before playing with Contrast and
692 ATM, but in practice that means trying without and then reverting,
693 playing with the curve, and trying again, or just doing it last.
694 Hopefully you will not have to use the curves tool very often.
699 The amount of sharpening to use depends not only on the picture, but on
700 the intended use: prints will require more sharpening. The tool is at
701 Filters -> Enhance -> Unsharp Mask. I normally begin with a Radius of
702 5.0 (the default) and an Amount of 0.90 (instead of 0.50). I have never
703 found a reason to put a value into the Threshold box. While testing this
704 procedure on some pics from an older camera (Olympus E-500), I found a
705 greater sharpness (5/1.0 or 5/1.2) was helpful - even though the picture
706 was apparently correctly focussed and not taken on the move.
708 For some pictures (those which are intrinsically less sharp, either
709 where the camera was moving, or because it was focussed on the wrong
710 place), a slightly larger Amount (up to 1.2, for example) sometimes
711 helps. But with sharpening for online use it is important both to zoom
712 in to look at the datails, and to zoom out to get a view of the whole
715 In a few cases (haze) a larger Radius can be useful (try 15, see what
716 changed, then use smaller or larger). The danger is that other parts of
717 the picture might be over-emphasized, or you might get odd effects with
718 higher values. With all the tools, but particularly with the unsharp
719 mask, by the time you can see the effect you have overdone it.
721 If you are printing on paper you probably want a different aspect ratio.
722 The A range of papers (usually A4 for inkjet photo paper) have an aspect
723 ration of 1.1414 (210:297). For prints, I take the prepared but
724 unsharpened image, save it to a new name, crop towards this ratio, and
725 then apply a stronger sharpening.
730 At this point, the image is still only in an xcf file. You can make a
731 jpeg from the File -> Export menu (until I took this multilayer approach
732 I was often forgetting that 'Save' is now only used for xcf files, but
733 now the separate Export seems natural to me :)
735 Change the suffix to .jpg from the default .png if this is the first
736 export in this session. I like to make the name whatever-90.jpeg so that
737 if the name matches the camera's name it will NOT overwrite the camera's
738 own jpg. For a jpeg, the next box allows you to set the quality, with a
739 default of 90. A quality of 90 (%) seems to be adequate, at least on my
740 20" screen or on A4 prints.
745 OTHER USEFUL PACKAGES:
747 1. Image::ExifTool is just a perl module, stable versions are at CPAN.
749 Most of what I have put online has included all the original EXIF data
750 from the camera, even though my pics are resized. It annoyed me
751 intensely to put up a pic claiming to be 3970 pixels wide when it was
752 actually only 1400 pix (yes, I get anal about this sort of thing - I
753 assume most LFS users do too ;)
755 There are a number of links for how to hide *all* EXIF data, but fewer
756 examples for just removing what is now wrong. Also, recent versions of
757 gimp-2.8 have started to write _some_ EXIF data into jpegs. That was a
758 bad surprise until I understood what was happening (I had a script from
759 the past which added EXIF data from the original image, and now there
760 was extra and inconsistent data).
762 At the moment, I am continuing to resize images to fit on _my_ screen -
763 see below - although there is probably no need to do that for flickr if
764 the picture is of good quality. I use a script to add EXIF data to the
765 small pics [ now I'm taking the EXIF data from the jpeg, which has fewer
766 fields than the raw files ] and I use the following command to get the
767 fields I want to use. Ideally, I would also show the lens details for
768 the Olympus, but I have not managed that. I hope the following is
769 sufficiently self-explanatory:
773 -Tagsfromfile ${MASTERDIR}/${FILEROOT}.jpg \
774 -overwrite_original \
785 "-copyright<=${COPYRIGHT}" \
786 "-comment<=${MYCOMMENT}" \
787 -m ${FILEROOT}-screen.jpg
789 Partial explanations:
790 -something= : remove this identifier (so, begin by removing *all*
791 fields). This has to come first.
792 -Tagsfromfile : where to get the EXIF data, the camera's own jpeg
793 -Overwrite_original : in this context, overwrite MY file instead of
795 -Make -Model etc : without '=', specify the fields to copy.
797 I have previously set $COPYRIGHT and $MYCOMMENT to point to files
798 which contain my claim of authorship, year, and the license, or a
799 brief description of the subject - for trains, usually just a general
800 comment such as "taken on the fubar railway".
803 2. ImageMagick is in the BLFS book. My own photos are larger than my
804 monitor, so to check what I have done I copy the jpeg to a directory set
805 aside for small images, then reduce it with the 'mogrify' command, e.g.
807 mogrify -resize 1200x900 filename.jpg
809 This is for photos keeping an approximately four-thirds format, it ensures
810 that the resulting image is never larger than 1200x900 (which fits on the
811 screen of the machine where I mostly do this). If the photo is in portrait
812 mode (i.e. vertical) it will restrict it to about 675x900. I then use the
813 display command to check that I have not done something silly.
818 1. What really got me started on this current method was
819 http://iffles.com/2010/03/11/faking-hdr-in-gimp/ although I only use the
820 first parts of that - as far as 'Well, more of the photo is exposed
821 properly now, I guess, but it still doesn’t “pop” like I want it to.
822 Note: This is where my tutorial differs from the instructables one.'
824 2. From that, I looked at the instructables reference -
825 http://www.instructables.com/id/HDR-photos-with-the-GIMP/ - I note that
826 this does NOT make the masks from the same layer, and uses the Curves
827 tool for the example image.
829 3. A Book, GIMP 2.8 for Photographers (I purchased my copy as a PDF from
830 http://shop.oreilly.com/product/9781937538262.do ) sections 3.16.3-4,
831 pages 286 - 294 in my copy - the example uses three png files, and seems
832 a lot more involved than my simplistic approach.
834 4. For an alternative introduction to (true) HDR, using different tools,
835 see e.g. http://photoblog.edu-perez.com/2009/02/hdr-and-linux.html
837 5. For an interesting review of raw processors and image formats, see
838 http://ninedegreesbelow.com/photography/linux-raw-processor-review.html
840 6. For somebody else's examples of psudo-HDR (using Photomatix Pro - a
841 non-linux commercial program), with a comparison to the original single
842 shot and with discussions of the whole idea, see
843 http://www.cambridgeincolour.com/forums/thread420.htm
845 7. For a long document on colour management and related issues, see
846 https://docs.kde.org/trunk4/en/extragear-graphics/digikam/raw-decoding.html