Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The purpose of this assignment is to use Python to merge several photographic el

ID: 3805186 • Letter: T

Question

The purpose of this assignment is to use Python to merge several photographic elements into a single photo. Part A 1. Search for and download a photograph of a jackrabbit. 2. Locate (or download) and use your antelope photograph from Topic 1. 3. Collage the two photos together. Trade the antelope’s legs with the jackrabbit’s. Part B 1. Take a head-to-toe photograph of yourself standing in front of a uniformly colored background. Take another picture of the background. 2. Collage the Jacklope image with yours to show yourself standing in front of the mythical creature. 3. Create an HTML Web document (not necessarily with Python) that displays the results and plays the blended WAV document that you created in Topic 5. Add a headline "Mythological Jacklope Discovered!"

Explanation / Answer

collage photos

import numpy as np

import matplotlib.pyplot as plt

def concat_images(img a, img b):" " "

combines two color image ndarray side-by-side

" " "

ha,wa=img a.shape[:2]

hb,wb=img b.shape[[:2]

max_height=np.max([ha,hb])

total_width=wa+wb

new_img=np.zeros(shape=(max_height,total_width,3),dtype=np.uint8)

new_img[:ha,:wa]=imga

new_img[:hb,wa:wa+wb]=imgb

return new_img

def concat_n_imges(image_path_list): " " "

combines Ncolor images from a list of image paths " " "

output=None

for i,img_path in enumerate(img_path_list):

img=plt.imread(img_path)[:,:,:3]

if i==0

output=img

else

output=concat_imgaes(output,img)

return output

/* html document*/

<!Doc type html>

<html>

<body>

<h1>"MYTHOLOGICAL JACKLOPE DISCOVERED!"</h1>

<object>

<param name="autostart"valu="true">

<param name="src" value="abc.wav">

<param name="autoplay" value="true">

<param name="controller" value="true">

<embed src="abc.wav"controller="true" autoplay="true">

<autostart="true" type="audio/wav"/>

</object>

</body>

</html>

save this as .html format and run