programing in jes ( jython )
DESCRIPTION
Programing in JES ( Jython ). Kayla Dean & Patrick Baker. Original Picture. Sunset. def sunset(filename): filename = makePicture ( pickAFile ()) explore(filename) for p in getPixels (filename): value = getBlue (p) setBlue (p, value * 0.7) value = getGreen (p) - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/1.jpg)
Programing in JES(Jython)
Kayla Dean&
Patrick Baker
![Page 2: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/2.jpg)
Original Picture
![Page 3: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/3.jpg)
Sunsetdef sunset(filename): filename =
makePicture(pickAFile()) explore(filename) for p in getPixels(filename): value = getBlue(p) setBlue(p, value * 0.7) value = getGreen(p) setGreen(p, value * 0.7) explore(filename)
![Page 4: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/4.jpg)
Sunset Pict
![Page 5: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/5.jpg)
Grayscaledef grayscale(filename): filename =
makePicture(pickAFile()) explore(filename) for p in getPixels(filename): sum = getRed(p) + getGreen(p)
+ getBlue(p) intensity = sum / 3 setColor(p, makeColor(intensity,
intensity, intensity)) explore(filename)
![Page 6: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/6.jpg)
Grayscale Pict
![Page 7: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/7.jpg)
Mirror Verticaldef mirrorVertical(filename): filename = makePicture(pickAFile()) explore(filename) mirrorPoint=getWidth(filename)/2 width=getWidth(filename) for y in range(0,
getHeight(filename)): for x in range(0, mirrorPoint ): leftPixel=getPixel (filename, x, y) rightPixel=getPixel (filename,
width-x-1,y) color=getColor(leftPixel) setColor(rightPixel ,color) explore(filename)
![Page 8: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/8.jpg)
Mirror Vertical Pict
![Page 9: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/9.jpg)
Mirror Horizontaldef mirrorHorizontal(filename): filename = makePicture(pickAFile()) explore(filename) mirrorPoint=getHeight(filename)/2 height=getHeight(filename) for x in range(0, getWidth(filename)): for y in range(0, mirrorPoint ): topPixel=getPixel (filename, x, y) bottomPixel=getPixel(filename,
x,height-y-1) color=getColor(topPixel) setColor(bottomPixel ,color) explore(filename)
![Page 10: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/10.jpg)
Mirror Horizontal Pict
![Page 11: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/11.jpg)
Line Detectdef lineDetect(filename): filename = makePicture(pickAFile()) for p in getPixels(filename): newRed = getRed(p)*0.229 newGreen = getGreen(p)*0.587 newBlue = getBlue(p)*0.114 luminance = newRed+newGreen+newBlue setColor(p,makeColor(luminance,luminance,luminance)) orig = (filename) makeBw = (filename) sketchLine = getWidth(orig)/2 for x in range(0,sketchLine): for y in range(0,getHeight(orig)-1): here=getPixel(makeBw,x,y) down=getPixel(orig,x,y+1) right=getPixel(orig,x+1,y) hereL=(getRed(here)+getGreen(here)+getBlue(here))/3 downL=(getRed(down)+getGreen(down)+getBlue(down))/3 rightL=(getRed(right)+getGreen(right)+getBlue(right))/3 if abs(hereL-downL)>=10 and abs(hereL-rightL)>=10: setColor(here,black) if abs(hereL-downL)<=10 and abs(hereL-rightL)<=10: setColor(here,white) show(makeBw) return makeBw
![Page 12: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/12.jpg)
Line Detect Pict
![Page 13: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/13.jpg)
Negate Bluedef negateblue(filename): filename =
makePicture(pickAFile()) for p in getPixels(filename): setBlue(p,0) show(filename)
![Page 14: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/14.jpg)
Negate Blue Pict
![Page 15: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/15.jpg)
Negativedef negative(filename): filename =
makePicture(pickAFile()) for px in getPixels(filename): red = getRed(px) green = getGreen(px) blue = getBlue(px) negColor = makeColor( 255-red,
255-green, 255-blue) setColor(px, negColor) explore(filename)
![Page 16: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/16.jpg)
Negative Pict
![Page 17: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/17.jpg)
Negate Greendef negategreen(filename): filename =
makePicture(pickAFile()) for p in getPixels(filename): setGreen(p,0) show(filename)
![Page 18: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/18.jpg)
Negate Green Pict
![Page 19: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/19.jpg)
Negate Reddef negatered(filename): filename =
makePicture(pickAFile()) for p in getPixels(filename): setRed(p,0) show(filename)
![Page 20: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/20.jpg)
Negate Red Pict
![Page 21: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/21.jpg)
Make Greendef green(filename): filename =
makePicture(pickAFile()) for p in getPixels(filename): setRed(p,0) setBlue(p,0) show(filename)
![Page 22: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/22.jpg)
Make Green Pict
![Page 23: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/23.jpg)
Make Reddef red(filename): filename =
makePicture(pickAFile()) for p in getPixels(filename): setGreen(p,0) setBlue(p,0) show(filename)
![Page 24: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/24.jpg)
Make Red Pict
![Page 25: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/25.jpg)
Make Bluedef blue(filename): filename =
makePicture(pickAFile()) for p in getPixels(filename): setRed(p,0) setGreen(p,0) show(filename)
![Page 26: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/26.jpg)
Make Blue Pict
![Page 27: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/27.jpg)
Other Codesdef filename():
filename=makePicture(pickAFile())
def sketchline(): sketchline = getWidth(filename)/2
![Page 28: Programing in JES ( Jython )](https://reader038.vdocuments.us/reader038/viewer/2022102620/568143a7550346895db02da9/html5/thumbnails/28.jpg)
Sourcehttp://www.clarkvision.com/galler
ies/gallery.all/web/lion.cub.c02.11.2005.jz3f4256.b-600.html Site for Original Picture.