I want to split two pictures (pic A and pic B – both same size) to Up and Down Halfs (A-Up,A-Down,B-Up,B-Down), and then create new images: A-up + B-Down and vise versa (meaning: I want to have a new picture that its upper half is in fact the upper of A and the down half is of B). I wrote the next function in python, using PIL module:
import Image
def SplitFunction(BMP):
im = Image.open(BMP)
[x,y]=im.size
box1=(0,0,x,y/2)
box2=(0,y/2+1,x,y)
region1 = im.crop(box1)
region2 = im.crop(box2)
region1.show()
region2.show()
return [region1,region2]
path1='c:/movie2frames/BMPs1/stim/1.BMP'
path2='c:/movie2frames/BMPs1/stim/334.BMP'
[r1a,r2a]=SplitFunction(path1)
[r1b,r2b]=SplitFunction(path2)
#end program
I don’t know how to paste the new parts. Any help would be much appriciated.
This is actually much easier if you keep the original full-size image and paste a new top half into it.