Hybrid Images

Introduction

One cool application in which we can do with two photographs is to create hybrid images out of them. A hybrid image is defined and discussed in Oliva et. al, 2006. In short, a hybrid image is an image which blends two images where a viewer may interpret one image at a close distance, while at a farther distance, may interpret the second image. The viewing distance in this case, is treated as a function.

Although a hybrid image is composed of two images, the individual components themselves must exhibit specific qualities in order to achieve the effect mentioned in the previous paragraph. The components of the hybrid image are composed of:

  1. A low-frequency component image resulting from a low-pass filter applied to it
  2. A high-frequency component image resulting from a high-pass filter applied to it.

When the components are then stitched together (phrasing), we are able to achieve the desired effect.

The Process

Most of the time, to create the component images, there must is some preprocessing involved. The low-frequency component image is achieved by applying a low-pass filter to an image I1. The low-pass filter can be a Gaussian filter with some cut-off frequency, σlow.
Hlow = G(I1, σlow) For the high-pass component of the image, Oliva et. al stated that this component of the image may just be the difference of the chosen image and the image with a low-pass filtered applied to it with some cut-off frequency σhigh. In this case, the image Hhigh can be computed from the chosen image, I2 like the following: Hhigh = I2 − G(I2, σhigh)

Where the function G is the low-pass filter with the corresponding cutoff frequency. In my examples, I chose to use a Gaussian filter.

What results from the individual images is a blurry image Hlow from I1, and an image with mostly its edges maintained, Hhigh from I2.

Together, we can build the hybrid image, H from the sum of the individual pixels from Hlow and Hhigh. H = Hlow + Hhigh Depending on the cut-off frequencies, and images used, the result obtained is essentially a blurry image with an image with its edges composited onto it.

Viewing the Hybrid Image

Gaining appreciation of the hybrid image depends on the distance at which the image is viewed at, and the length of time.

When the hybrid image is viewed from a close distance, or for some time, the high frequency image dominates the perceptual system. However, triggering the low frequency component of the image is possible by viewing the hybrid image at a distance, or shrinking the image until the low frequency image can be seen. An alternative is to quickly glance at the hybrid image, and the low frequency image can also be seen.

Examples

Here are some examples of some hybrid images constructed. The parameters are given in each respective table.

Barack and Michelle Obama

Picture Type Sigma Value
Barack Obama Low Frequency Low 8
Michelle Obama High Frequency High 20

Sources

  • Barack Obama - https://wikipedia.org

  • Michelle Obama - https://biography.com

Original Images

Barack Obama Unfiltered
Michelle Obama unfiltered

FFT of Images

The left image is the frequency representation of Barack Obama, while the right image is the frequency representation of Michelle Obama.

FFT of Barack Obama and Michelle Obama

Filtered Images

Barack Obama with low pass filter applied
Michelle Obama with high pass filter applied

Hybrid Images

Hybrid image at original scale
Hybrid image viewed from afar

FFT of Hybrid Image

The left FFT image is the FFT of the filtered Barack Obama image, while the right FFT image is the filtered Michelle Obama image. The resulting FFT, which is the hybrid image in frequency domain is shown as the third image.

FFT of components and hybrid image

Kim Jong Un and Donald Trump

Picture Type Sigma Value
Kim Jong Un Low Frequency Low 15
Donald Trump High Frequency High 10‌

Sources

  • Kim Jong Un - The Sumter Item (https://theitem.com)
  • Donald Trump - Brittanica (https://britannica.com)

Original Images

Kim Jong Un unfiltered
Donald Trump unfiltered

FFT of Images

The left image is the frequency representation of Kim Jong Un, while the right image is the frequency representation of Donald Trump.

FFT of Kim Jong Un and Donald Trump

Filtered Images

Kim Jong Un with low pass filter applied
Donald Trump with high pass filter applied

Hybrid Images

Hybrid image at original scale
Hybrid image viewed from afar

FFT of Hybrid Image

The left FFT image is the FFT of the filtered Kim Jong Un image, while the right FFT image is the filtered Donald Trump image. The resulting FFT, which is the hybrid image in frequency domain is shown as the third image.

FFT of components and hybrid image

Roger and Alexa

For kicks, here is me and my wife.

Picture Type Sigma Value
Roger Low Frequency Low 60
Alexa High Frequency High 40

Original Images

Roger unfiltered
Alexa unfiltered

FFT of Images

The left image is the frequency representation of myself, Roger, while the right image is the frequency representation of Alexa.

FFT of Kim Jong Un and Donald Trump

Filtered Images

Roger with low pass filter applied
Alexa with high pass filter applied

Hybrid Images

Hybrid image at original scale
Hybrid image viewed from afar

FFT of Hybrid Image

The left FFT image is the FFT of the filtered Roger image, while the right FFT image is the filtered Alexa image. The resulting FFT, which is the hybrid image in frequency domain is shown as the third image.

FFT of components and hybrid image

Tiger and Lion

Picture Type Sigma Value
Tiger Low Frequency Low 10
Lion High Frequency High 20

Sources

  • Tiger - https://scientificamerican.com
  • Lion - https://nationalzoo.si.edu

Original Images

Tiger unfiltered
Lion unfiltered

FFT of Images

The left image is the frequency representation of the tiger, while the right image is the frequency representation of the lion.

FFT of Tiger and Lion

Filtered Images

Tiger with low pass filter applied
Lion with high pass filter applied

Hybrid Images

Hybrid image at original scale
Hybrid image viewed from afar

FFT of Hybrid Image

The left FFT image is the FFT of the filtered tiger image, while the right FFT image is the filtered lionimage. The resulting FFT, which is the hybrid image in frequency domain is shown as the third image.

FFT of components and hybrid image

Color Hybrid Images

The process in generating a color hybrid image is the same, except for some other considerations:

  • Since color images have additional channels as opposed to a single intensity channel as found in grayscale images, we must operate on each individual channels.
  • Summing up the pixel values for color images may cause color artifacts to appear on pixels. Thus, clamping down the pixel values after adding them to between 0, and 255 should remove most of the artifacts.
  • The cut-off frequencies may be different and thus need further adjustment as opposed to the grayscale hybrid case.

The question arises as to whether or not it is practical to use color in both the low and high frequency components of the color hybrid image. What I have observed is that only the color of the low frequency image dominates. This is because when applying the high pass filter to the color image, only the edges are taken to consideration. Therefore, we may be able to achieve the same effect by just using a grayscale image for the high frequency image.

The example below shows two color hybrid images. The first shows a color hybrid image constructed with both low and high frequency components being in color, and the second shows construction using a low frequency color image, and a high frequency grayscale image.

Example: 2 Color Components

Color hybrid image with 2 colored components
Color hybrid image with 2 colored components viewed from afar

Example: Low frequency color component, High frequency grayscale component

Color hybrid image with 2 colored components
Color hybrid image with 2 colored components viewed from afar

Choosing the Image Components for Hybrid Images

In order to be successful at creating hybrid images, we need to be able to choose good candidates for the low, and high frequency components. So, what makes a good candidate for a low frequency, and high frequency image?

A good low frequency image is one that:

  • Is recognizable from far away (objects and people with distinct qualities)
  • Low density in edges (few edges and transitions across subjects)
  • Simple shapes

Examples of good low frequency images used in the hybrid samples shown earlier:

  • With the image of myself and my wife, my hair is much more simple, and I do not have make up on my face. Therefore, when this image is blurred, I am still recognized as an adult male.
  • With the image of Barack Obama, and Michelle Obama, the image of Barack Obama is chosen to be a good candidate for a low frequency image because he is an easily recognizable political figure. Thus from afar, can be distinguished.
  • The image of Donald Trump and Kim Jong Un utilizes the latter as a low frequency component. Un’s portrait is chosen as a low frequency image because of his smooth skin relative to Donald Trump’s, and dark hair which can be simplified to being a continuous shape.
  • The lion and tiger are more difficult to determine, but choosing the tiger in this case, to be the low frequency image because the stripes are more recognizable from afar compared to the lion.

What makes a good high frequency image?

  • Strong edges, and transitions
  • Details
  • When viewed from afar, these details should begin to become perceptually indistinguishable.

Examples of good high frequency images chosen from above examples:

  • The picture of my wife is good because of the frequency in changes of her hair.
  • Michelle Obama’s necklace and makeup causes some changes, but overall, in comparison to the Barack Obama picture, can also be used as a low frequency image with some low pass filters applied.
  • Donald Trump is used as a high frequency image because of his thinner strands of hair and wrinkles on the face. Because of this, there is much more detail maintained.
  • As mentioned before, the tiger’s stripes is recognizable from far away, and so the lion image can be used as the high frequency component.

Conclusion

Overall, the perceptual experience in hybrid images is determined by the choice of images used. Choosing good images to be used for low frequency and high frequency images is important in building a good hybrid image.

But that is not all, as when observed closely, the examples above have had good image alignment. Having images with similar alignment will aid in producing a convincing result.