Docsity

Mirror Pixels Programs - Introduction Media Computation - Assignment | CS 1315, Assignments of Computer Science

Toggle sidebar
bg1
Mirror Pixels Program: Recipe #20
def mirrorVertical(source):
mirrorpoint = int(getWidth(source)/2)
for y in range(1,getHeight(source)):
for xOffset in range(1,mirrorpoint):
pright = getPixel(source, xOffset+mirrorpoint,y)
pleft = getPixel(source, mirrorpoint-xOffset,y)
c = getColor(pleft)
setColor(pright,c)
In this program I have chosen to mirror an image of the Eiffel Tower in Paris, France.
In this particular image, I have chosen to mirror the image along its vertical axis. This
way the left side will imitate the right side. You can mirror that image at different
point throughout the picture but I have chosen to do it directly in the middle to create
a symmetrical affect. This was done by dividing the source/2.
Original Picture Mirrored Image

Partial preview of the text

Download Mirror Pixels Programs - Introduction Media Computation - Assignment | CS 1315 and more Assignments Computer Science in PDF only on Docsity!

Mirror Pixels Program: Recipe # def mirrorVertical(source): mirrorpoint = int(getWidth(source)/2) for y in range(1,getHeight(source)): for xOffset in range(1,mirrorpoint): pright = getPixel(source, xOffset+mirrorpoint,y) pleft = getPixel(source, mirrorpoint-xOffset,y) c = getColor(pleft) setColor(pright,c) In this program I have chosen to mirror an image of the Eiffel Tower in Paris, France. In this particular image, I have chosen to mirror the image along its vertical axis. This way the left side will imitate the right side. You can mirror that image at different point throughout the picture but I have chosen to do it directly in the middle to create a symmetrical affect. This was done by dividing the source/2. Original Picture Mirrored Image