O'Reilly logo

Python Multimedia Beginner's Guide by Ninad Sathaye

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - blending two images

Sometimes, the combined effect of two images mixed together makes a big impact compared to viewing the same images differently. Now it's time to give way to your imagination by blending two pictures together. In this example, our resultant image shows birds flying over the Mackinac bridge in Michigan. However, where did they come from? The birds were not there in the original image of the bridge.

  1. Download the following files from Packt website: 0165_3_28_BRIDGE2.png and 0165_3_29_BIRDS2.png. Rename these files as BRIDGE2.png and BIRDS2.png respectively.
  2. Add the following code in a Python source file.
    1 import Image 2 3 img1 = Image.open( "C:\\images\\BRIDGE2.png ") 4 img1 = img1.convert('RGBA') 5 6 img2 = Image.open( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required