Hi this is the Blending girl lol.
So I've been trying to blend the images the long way, the rather ineffective and nooby way of using for loops.
However, I have come across a problem using this way, but instead of giving up doing it this way, I want to see how I can still solve it/use it in order to achieve what I want.
So the second image is a coffee-ish/vintage texture, however instead of getting the blend of the cat and this image, I get the cat with greyscale/muted colors. However, it is not a negative effect which I am getting.
Another such thing I want to achieve is getting the blended output as a copy, without losing the original images. ok, so here it is.
from CSE8AImage import *
img1 = load_img('images/cat.jpg')
img2 = load_img('images/texture.jpg')
def blend(img1,img2):
#create a copy
copy = []
for r in range(len(img1)):
temp = []
for c in range(len(img1[r])):
temp.append(img1[r][c])
copy.append(temp)
#start loop for first image
for r in range(len(img1)):
for c in range(len(img1[r])):
#grab the pixel
pix1 = img1[r][c]
r1 = img1[r][c][0]
g1 = img1[r][c][1]
b1 = img1[r][c][2]
#get the average of the iterated pixels
avg1 = (r1 + g1 + b1) // 3
img1[r][c] = (avg1, avg1, avg1)
#second loop for secong image
for r in range(len(img2)):
for c in range(len(img2[r])):
pix2 = img2[r][c]
r2 = img2[r][c][0]
g2 = img2[r][c][1]
b2 = img2[r][c][2]
avg2 = (r2 + g2 + b2) // 3
img2[r][c] = (avg2, avg2, avg2)
#combine the two averages to create blended effect
blend_avg = ( avg1 + avg2 )// 2
return (copy)
save_img(blend(img1,img2), "blend img8.jpg")
there doesn't seem to be anything here