Color Interpolation

What are you doing right now? Surfing the web for neat pictures like thousands of other people are. If you maintain your own page or are considering doing so, think about what pictures you would display. Remember that the entire world will have access to them. Do you want a picture of yourself wearing a shirt with a spot on it? Obviously you would like all of your pictures to be without defects.

In order to attain this desire, you will need to repaint the defective portions of the images. One method for generating the replacement portions for images is to use polynomial interpolation to generate smooth color gradients. For more information consider my paper on the subject. Thanks go to Dr. Vince Ervin for inspiring (okay requiring) a numerical mathematics project.

The first set of images demonstrate the effectiveness of color interpolation using a small number of sample points. Notice that the background on the left side of the coke can below does not match the background on the right.

The image is 120 pixels in height. Twelve of these points (equally distributed from 1 to 111) were sampled to produce interpolations used to replace the left side background. Notice the smoothness of the gradients.

Cubic spline with not-a-knot condition

Least square error (3rd degree)

(6th degree)

(9th degree)

This second set of images was created to test the ability of interpolated areas to fit smoothly into the rest of the picture. The original picture is on e of myself (I didn't dare do this with anyone else's picture).

Original image

In order to maximize the possibility of problems, the entire forehead region was replaced with interpolated versions of it. The bottom edge, which is just above the eyebrows, is a straight line. If the colors don't match closely, then there should be an unnatural straight line across my forehead. Also, in case you hadn't noticed, the forehead region has been stretched in the following images. Because the edits were performed column by column with no consideration for the effects on the rows, it was possible that the forehead would look like a lot of vertical lines of different colors.

Cubic spline

Least square error (3rd degree)

(6th degree)

(9th degree)


Return to the math page.