Here’s How I Did It - Open Source Graphic Design

May 21, 2008

GIMP: Restore a Torn Photograph (Part 2)

Filed under: GIMP — Jude @ 11:00 am

You’ll remember last week I started a pretty large photo restoration project trying to piece together an old photograph.

This week I’ll show you how I go about “healing” the tear line and removing some of the major blemishes from it.

When you’re working on something particularly heavy-going it can be difficult to see what’s going on after a while. I like to go away, have a break and go back to it with fresh perspective. That’s exactly what I did today and when I went back to start working on the project again I noticed I hadn’t lined it up quite as well as I thought.

Slight rotation required to align the edges

Initially it looked as though the picture was lined up pretty well - the bars on the window, the man’s face and even the edge of the picture looked fine but when I zoomed in to start removing the tear line I noticed the white border on the left wasn’t aligned correctly (see left). Everything else looked right so what’s the problem? Rotation.

That’s something to keep in mind when you scan images - no matter how carefully you line it up on the edge of the scanner either by static or airflow the image nearly always gets moved slightly.

Rotating the top portion by just -0.23° fit everything back into place.

Feathering caused by scanning needs to be removed before flattening the imageBefore beginning to heal the tear, areas of special detail will probably need their own treatment. You’ll see where the tear passes through the man’s face that there is still some black feathering from when it was scanned. On other areas of flatter colour, like the curtains or walls, it’s simple to clone this out but where there are detailed features on the face we’ll need to remove as much contamination as possible. The layers will need to be flattened later so it’s important to get rid of anything along the borders at this stage.

 

Harsh black edge is removedNow that the harsh black edge has been removed, the extent of the tear can be seen. It still looks severe but it should be much easier to heal up later.

When you’re happy that all the detailed areas have been cleaned up it’s time to save with a new file name (so you can go back if you go wrong) and merge the layers. Select the top layer and go to Layers>Merge Down to flatten the image into one layer.

Now let’s begin healing up the tear.

For small differences I like using the Heal Tool Heal Tool in gimp. It’s somewhere between Smudge and Clone and samples the colour and texture of the surrounding pixels so you can paint a kind of average colour. Ctrl+click on a clean area near to your tear to set the target area, now use your cursor as usual to paint over the tear. Be careful to keep your target away from the edges or you’ll get unsightly white or dark smudges in your freshly papered-over crack.

Heal tool helps smooth out creases and tears.The tear has been repairedHeal smooths it over but because the colours are based on the surrounding colours there’s still a visible darkened area. This is where Clone comes in handy.

Clone works in much the same way as Heal so use Ctrl+click to select a clean area and paint over the darkened line where the tear was. The key to avoiding circular patterns is to keep the brush moving rather than dab at areas. Clone will copy the area under the target cursor to where you’re painting. To avoid noticeable repetition you can build up layers by setting the brush opacity to 50%.

Left: Beginning to heal the tear along the border, Right: After healing and some cloning.

Now most of the tear has been removed you can get a better idea of how the picture once looked.Areas of flat colour like that are easy to fix. As you work along the tear, repeat the same process to close up any gaps. On areas like the curtains take care to keep your brush strokes vertical to blend in with the transitions from light to dark.

You’ll probably find you will need to switch between Clone and Heal as you fix up the tear. For areas where there is a lot of colour missing you could try cloning at 100% opacity to fill the gaps, then heal to blend it and then add detail again with 50% opacity clone. There are no rules on how best to do it so experiment until you get something you’re happy with. The Undo Command (ctrl+z) will come in very useful.

You’ll also find that you’ll have to change between brush sizes depending on the detail required. For example, replacing the window uprights required a very small clone brush. For large areas of one colour increase the brush size to reduce repetition.

Here’s how the photo looked after fixing most of the tear. I’ve left the face and shoulder area alone to work at in detail (left).

To try and repair the face zoom right in - enough to work easily on the area but far enough to have good overview.

Much of the man’s chin was lost when the photograph was torn so it will have to be reconstructed. For this I first cloned the area, using a very small brush, trying to match the skin tones with the contours of his chin. This was pure guesswork since we’ll never really know how he looked.

Cloning produced a rather chunky pixelated look so this was softened using the Heal Tool. The image below shows before, after cloning, after healing on chin.
Repairing the chin using clone and heal

There’s so much of the face missing we’ll have to guess at that too. Using a combination of Cloning and Healing, sample areas near to the tear and replace the lost areas as done with the chin.This was by far the most challenging part of the photograph.

Here’s how the face looked after a lot of work.
Face repaired

The original photo had a stain right on the corner of the mouth. After some deliberation I decided to leave it there. Trying to repair that would have meant that 70% of the mouth was replaced and in my opinion that would have had too much impact on the face.

I also chose to leave the stamp mark from the original picture and the crease that ran through the woman’s body.

I felt that the stamp didn’t detract from the image and rather it added to the character of the image.

The crease through the woman’s body was left because to remove it would have altered the image a lot. You can see that there’s a large colour difference either side of the crease requiring a lot of blending between the two tonal areas which may have resulted in a “touched-up” look.

So here is the before and after:

Before restorationThe restored photograph

I hope to print this onto some cotton rag to complete the restoration.

If you want to have a go at this, go here and read through part 1 of the tutorial and download accompanying file if you want to work on this image.

Do you have any comments or opinions on this? Did you try the restoration yourself? Got a better method? Let me know with a comment.

May 16, 2008

GIMP: Restore a Torn Photograph (Part 1)

Filed under: GIMP — Jude @ 4:02 pm

A while ago my soon-to-be mother-in-law dropped by with an family photograph she had found in a box of old pictures. She was putting together her family tree and this was the only existing picture of some long-dead relations - but it was torn in half and pretty battered. To make matters worse, since I had taken this copy the original had been lost. Could anything be done to restore it? Here’s my attempt.

The image was scanned as below at 400dpi. I realise I could have pieced the picture together before scanning but I thought scanning them as two pieces would allow for greater flexibility.

Torn Image is scanned inOne half of the picture separatedYou’ll notice that there is a certain amount of overlap; an area of paper is visible where the two pieces sheered away from each other when it was ripped. This will need to be remedied later.
To start piecing it back together I had to get rid of the black area created by the scanner. Thankfully the Scissors Select Tool Scissors Selectwas made for this kind of thing!

Look out for an in-depth tutorial on this tool in the next few days.

I cut out each half and pasted it into its own layer. I could then move the bottom half up the canvas and begin piecing it together.

The torn areas from the top layer continue to show through while underneath it the missing part of the picture is hidden. You can also see that although the Scissors Tool did an excellent job of detecting the edge of the photo, there’s still a feathering of black.

The next stage is to move the layers around until the picture is as well aligned as possible. Luckily with this picture the vertical and horizontal bars of the sash window made it painless to line up. Without something like that you could carefully align it by eye or use the edges as a guide. When moving the pieces around the arrow keys will let you to move each layer by a pixel or two at a time.

A few large areas of paper were showing where the tear occured. To get rid of this it simply needs to be removed from the top layer as the missing fragment should still be present in the layer below. For this I’m going to use my favourite - Scissor Select.

The torn edge is selected to be removed Torn edge is removed

The light brown area along the margin is where some of the coating has lifted away from the paper. This will have to be rectified later by reproducing that part of the image.

Once the torn edge has been minimised the photograph looks more crumpled than torn and you can start to see the man’s face.

The torn image pieced together in GIMP

The final stage for now is to zoom in and work along the tear, removing any feathering that may have occurred.

Stick around over the next few days when I’ll be showing you how to reduce the blemishes in the photograph and begin to sympathetically enhance it. If you want to work along with me you can download the original file. As always, don’t forget to read the license. Creative Commons License

Powered by WordPress