Ejemplo n.º 1
0
"""
Demonstrates the pixelMapper function
Submitted by: Christobel Nweke
"""

import lab7Functions
import cImage

# Read an image to be transformed
oldImage = cImage.FileImage("flowers.png")

# Transform the image
newImageG = lab7Functions.pixelMapper(oldImage, lab7Functions.grayPixel)
newImageN = lab7Functions.pixelMapper(oldImage, lab7Functions.negativePixel)
newImageS = lab7Functions.pixelMapper(oldImage, lab7Functions.sepiaPixel)


lab7Functions.displayImage(lab7Functions.makeStackedImages(oldImage, newImageG))
lab7Functions.displayImage(lab7Functions.makeStackedImages(oldImage, newImageN))
lab7Functions.displayImage(lab7Functions.makeStackedImages(oldImage, newImageS))
Ejemplo n.º 2
0
"""
Demonstrates makeDiagonal function

Submitted by: Christobel Nweke
"""

import lab7Functions

# Create a diagonal image...
amazingImage = lab7Functions.makeDiagonal(400, lab7Functions.redPixel)

# ... and display it
lab7Functions.displayImage(amazingImage)
Ejemplo n.º 3
0
"""

import lab7Functions
import cImage

myImage = cImage.FileImage("eiu.png")
billy = cImage.FileImage("billy.png")

# Upper left corner
newImage = lab7Functions.makePIP(myImage, billy, 0, 0)

# Upper right corner
newImage = lab7Functions.makePIP(newImage,
                                 billy,
                                 0,
                                 newImage.getWidth() - billy.getWidth())

# Lower left corner
newImage = lab7Functions.makePIP(newImage,
                                 billy,
                                 newImage.getHeight() - billy.getHeight(),
                                 0)

# Lower right corner
newImage = lab7Functions.makePIP(newImage,
                                 billy,
                                 newImage.getHeight() - billy.getHeight(),
                                 newImage.getWidth() - billy.getWidth())

lab7Functions.displayImage(newImage)
Ejemplo n.º 4
0
"""
Demonstrates the makeStackedImages function
Submitted by: Christobel Nweke
"""

import lab7Functions
import cImage

# Read two files of photos
topImage = cImage.FileImage("flowers.png")
bottomImage = cImage.FileImage("tug.png")

# Create a stacked image with one photo above another, then display it
desiredImage = lab7Functions.makeStackedImages(topImage, bottomImage)
lab7Functions.displayImage(desiredImage)
Ejemplo n.º 5
0
"Submitted by: Christobel Nweke"
import lab7Functions

test = lab7Functions.makeRectangle(400, 200, lab7Functions.bluePixel)

lab7Functions.displayImage(test)