Guided Inpainting

(see bottom of page for a second example)

ObjectRemoval2.java Cubic.java

Instructions:

1. Click four times: twice along the edge before the missing area, and twice along the edge after the missing area.

2. press "r" to redraw the final image.

3. Press "n" to start on the next spline. (The more splines you add the better the final inpainted picture will look.)

This project demonstrates a way to fill missing information into a picture. The program fills in the color of missing areas with the surrounding colors. One problem with that approach is that sometimes a color propagates too far, making the picture look like a watercolor painting that has had water spilled on it. To prevent this, I made it possible to draw catmull-rom splines (short curves) with the appropriate color on each side across gaps to prevent this color spilling.

The interface works like this. You always draw on the top image, and the finished result is shown on the bottom. To create a spline, tap four times along the edge you want to complete. Tap twice along the edge before the gap, and twice after the gap. The curve will be fit to these points. If you tap too many times, just go back to the first point and start again. Ignore what the curve is doing until you have made your four taps.

On the top image, two parallel colored curves should appear between where you tapped the second and third times. If they look like they are in the right place, press "r" and it will refresh the bottom image. If you like the effect, press "n" to keep the change and begin drawing your next curve. In this way you can repair all the places where the color leaks into areas it shouldn't.

Yes I'm aware it is a lousy interface that doesn't allow you to load or save your image, undo a mistake once "n" has been pressed, won't let you zoom close enough to get your points in exactly the right spot, won't let you edit previously placed splines, and similar troubles.

Follow the same directions to remove the title from this magazine cover.