""" CSM 2170 -- Spring 2018 Assignment: Submitted by: Nathan Bartholomew """ import lab8Functions as f f.displayImage(f.makeLowerTriangle(100, f.redPixel))
""" Demonstrates the makeStackedImages function """ import lab8Functions import scipy.misc as misc # Read two files of photos topImage = misc.imread("flowers.png") bottomImage = misc.imread("tug.png") # Create a stacked image with one photo above another, then display it desiredImage = lab8Functions.makeStackedImages(topImage, bottomImage) lab8Functions.displayImage(desiredImage)
""" Demonstrates the pixelMapper function """ import lab8Functions as lab8Fn import scipy.misc as misc # Read an image to be transformed oldImage = misc.imread("flowers.png") # Transform the image newImage = lab8Fn.pixelMapper(oldImage, lab8Fn.grayPixel) lab8Fn.displayImage(lab8Fn.makeStackedImages(oldImage, newImage))
""" CSM 2170 -- Spring 2018 Assignment: Submitted by: Nathan Bartholomew """ import lab8Functions as f f.displayImage(f.makeRectangle(400, 200, f.bluePixel))
""" Demonstrates makeBandedDiagonal function Submitted by: """ import lab8Functions # Create an image and display it amazingImage = lab8Functions.makeBandedDiagonal(400, 1, lab8Functions.redPixel) lab8Functions.displayImage(amazingImage) # Now a second image amazingImage = lab8Functions.makeBandedDiagonal(400, 3, lab8Functions.greenPixel) lab8Functions.displayImage(amazingImage) # And a third amazingImage = lab8Functions.makeBandedDiagonal(400, 100, lab8Functions.bluePixel) lab8Functions.displayImage(amazingImage)
""" Demonstrates displayImage function Submitted by: """ import lab8Functions as lab8Fn import scipy.misc import numpy as np # Desired size of the rectangular image width = 400 height = 400 # Create a square image of a single color, initially black amazingImage = lab8Fn.emptyImage(height, width) # Change every pixel in this square to blue for row in range(height): for col in range(width): amazingImage[row, col] = lab8fn.bluePixel # ... and display it lab8Fn.displayImage(amazingImage)
# for i in range(3): # billy[r, c, i] = int(billy[r, c, i] * (billy[r, c, 3] / 255) + 255 * (1 - billy[r, c, 3] / 255)) # # billy = billy[:, :, 0:3] # # misc.imsave('billy.png', billy) # Upper left corner newImage = f.makePIP(myImage, billy, 0, 0) # Upper right corner newImage = f.makePIP(newImage, billy, 0, len(newImage[0]) - len(billy[0])) # Lower left corner newImage = f.makePIP(newImage, billy, len(newImage) - len(billy), 0) # Lower right corner newImage = f.makePIP(newImage, billy, len(newImage) - len(billy), len(newImage[0]) - len(billy[0]) f.displayImage(newImage)