I have a function that changes the original image to gray scale, negative image and the color yellow to blue. The code is supposed to run and show the images in 3 different windows. How can I put them all in one, horizontally? here is the code.
p.s I won't be using PIL.
from cImage import *
#there is a code here that that defines the functions, i've cut it out from my
question
def generalTransform(imageFile):
myimagewindow = ImageWin("Image Processing",300,200)
oldimage = FileImage(imageFile)
oldimage.draw(myimagewindow)
newimage = pixelMapper(oldimage,changeYellowToBlue)
newimage.setPosition(oldimage.getWidth()+1,0)
newimage.draw(myimagewindow)
myimagewindow.exitOnClick()
def main():
generalTransform("mickey.gif")
main()
def makenegative(imageFile):
oldImage=FileImage(imageFile)
width=oldImage.getWidth()
height=oldImage.getHeight()
myImageWindow=ImageWin('negativeimage', width*2, height)
oldImage.draw(myImageWindow)
newIm=EmptyImage(width, height)
for row in range(height):
for col in range(width):
oldPixel=oldImage.getPixel(col, row)
newPixel=negativePixel(oldPixel)
newIm.setPixel(col, row, newPixel)
newIm.setPosition(width+1, 0)
newIm.draw(myImageWindow)
myImageWindow.exitOnClick()
def main():
makenegative("mickey.gif")
main()
def makeGrayscale(imageFile):
oldImage=FileImage(imageFile)
width=oldImage.getWidth()
height=oldImage.getHeight()
myImageWindow=ImageWin('grayimage', width*2, height)
oldImage.draw(myImageWindow)
newIm=EmptyImage(width, height)
for row in range(height):
for col in range(width):
oldPixel=oldImage.getPixel(col, row)
newPixel=grayPixel(oldPixel)
newIm.setPixel(col, row, newPixel)
newIm.setPosition(width+1, 0)
newIm.draw(myImageWindow)
myImageWindow.exitOnClick()
def main():
makeGrayscale("mickey.gif")
main()
This is part of the code.