Pixel Transformations

Blurring Images

Gaussian method



One way we can blur an image is to convolve it with a gaussian filter. This has the effect of removing the high-frequency components, making the image suitable for sub-sampling without introducing aliasing artifacts.

Fourier method



Another way to blur an image is to first convert it to the frequency domain using the Fourier Transform. After doing this, it is easy to remove the high frequency components by simply zeroing out parts of the image. (Such as by multiplying the image by a gaussian filter.) Taking the inverse Fourier transform will restore the original image with some details lost.


Original Fourier Transform



Edited Fourier Transform

Sharpening Images

Despite its name, the ''unsharp'' filter is used to sharpen images, not blur them. It's name comes from the process of sharpening an image by subtracting an unsharp copy of the image.



The image on the right was convolved with an unsharp filter, mimicking the process of subtracting a blurry copy.


Original Image



Sharpened Image

Adjusting Contrast

Original Images





One way to adjust the contrast in an image is to apply a power-law transform on each color channel. Using an exponent of greater than 1 will darken the image, while using an exponent of less than 1 will lighten it.



Here, I have lightened the image by using an exponent gamma=0.6.

Gamma Adjusted Images





Another way to adjust the contrast of an image is to equalize the histogram of the image. This has the advantage of spreading out the intensities of the image no matter the initial distribution, so we can use this method on light, washed-out images, as well as dark, underexposed images.



We can use histogram equalization on color images as well as intensity/grayscale images. To do this, we convert the image to CIELab color space, and operate on the lightness values only. Otherwise, we may change the colors of the image.

Histogram Equalized Images





Ghosts!

We can add a ghost into an image by extracting the edges of a figure and adding it to a new background. Here, I picked an image with a flat background for the ghost so that we don't add ghostly edges that aren't part of the figure.



I used a Laplacian of Gaussian filter to make the ghost, and composited it with the background by simply adding the pixel values.