Fichas
Graphics Exam

Fichas del conjunto (52)
- 1Design Principlesbalance
proximity/alignment
unity
emphasis
rhythm
UPBEAR! - 2Principles: Balancesymmetrical - formal
asymmetrical - informal - 3Principles: Proximity / AlignmentGrouping (content, shape, or color)
Lining up (lead eye)
Grids (formalised division) - 4Principles: UnitySimilar Elements
(shapes, colors, typography) - 5Principles: EmphasisParts more important than others
Focal point (seen first)
Contrast - 6Principles: RhythmMovement through repetition
Progressive rhythm
(moves through a design in equal amounts)
Alternating rhythm
(creates a visual flow through a design to direct the viewer) - 7GIMP: Scale Imagepdb.gimp_image_scale
(image0,
posterW, posterH) - 8GIMP: Create Layerlayer0 = gimp.Layer
(poster, "Layer 0",
posterW, posterH,
RGBA_IMAGE, 100, NORMAL_MODE) - 9GIMP: Add Layerposter.add_layer
(layer0, 0) - 10GIMP: Image Translate (move)layer0.translate
(0, 0) - 11Turtle Drawing Steps1. Make pen object
2. Set pen features
colour, width, etc
3. Draw
using the functions - 12Drawing Steps: 1. Make pen objectPen()
- 13Drawing Steps: 2. Set pen features colour, width, etcpen.color("red")
pen.speed(0)
pen.width(1) - 14Drawing Steps: 3. Draw using the functionspen.forward(100)
pen.left(45) - 15GraphWincanvas = GraphWin
(“Turtle Graphics”,
500, 500);
canvas.setBackground(“blue”)
w, h =
canvas.getWidth(),
canvas.getHeight()
t = Turtle(); - 16Treedef tree(n, l):
if n==0 or l<2 :
return
pen.forward(l)
pen.left(45)
tree(n-1, l/2)
pen.right(90)
tree(n-1, l/2)
pen.left(45)
pen.backward(l) - 17Kochdef koch(n, l):
if l<2 or n==0:
pen.forward(l)
koch(n-1,l/3)
pen.left(60)
koch(n-1,l/3)
pen.right(120)
koch(n-1,l/3)
pen.left(60)
koch(n-1,l/3); - 18High Level Filter: Blurdef blur(self, radius = 3):
how = ImageFilter.GaussianBlur(radius)
newImage =
self.image.filter(how)
return newImage - 19High Level Filter: Embossdef emboss(self):
how = ImageFilter.EMBOSS
newImage = self.image.filter(how)
return newImage - 20PROCESSING Create An Empty ImagenewImage = Image.new("RGB", (self.width, self.height))
- 21Image Package Importsfrom PIL import Image, ImageFilter
- 22Turtle Attributeslocation
orientation
pen - 23Pen Attributescolour
width
up/down - 24Turtle For Loopfor i in range(4):
pen.forward(l)
pen.left(90) - 25Turtle Screenscreen = Screen()
screen.bgcolor("black") - 26GIMP: Import GIMP packagefrom gimpfu import *
- 27GIMP: Create poster functiondef poster(file0, file1...)
- 28PIL open imageim = Image.open(“lena.jpg”)
- 29Define a TKinter Class

- 30Tkinter 1 import tinterfrom tkinter import *
from tkinter.ttk import * - 31Tkinter 2 create tkinterroot = Tk()
root.geometry(“500x500+300+300”)
root.title(‘Money Converter”) - 32Tkinter 3 make listsrates= [0.5, 0.6, 0.7, 0.8]
names = [“Euro”, “Yen”, “Ruble”, “USD”] - 33Tkinter 4 cleardef onClear():
euroStr.set(“”)
yenStr.set(“”)
rubleStr.set(“”)
usdStr.set(“”) - 34Tkinter 5 convert function 1 get the value from euroStr, make it a floateuroValue = float(euroStr.get())
- 35Tkinter 5 convert function 2 find the selections from the 2 drop down menusfromIndex = currencies.index(euroDropDownStr.get())
toIndex = currencies.index(dollarDropDownStr.get())
rate = rates[toIndex]/rates[fromIndex] - 36Tkinter 5 convert function 3 equationdollarValue = euroValue * rate
- 37Tkinter 5 convert function 4 see the amount of dollars in dollarStrdollarStr.set(str(dollarValue))
- 38Tkinter 6 make interface 1 labeleuroLabel = Label(root, text = "From")
euroLabel.grid(row = 1, column = 0) - 39Tkinter 6 make interface 2 dropdowneuroDropDownStr = StringVar()
euroDropDown = OptionMenu(root, euroDropDownStr, currencies[0], *currencies)
euroDropDown.grid(row = 1, column = 1) - 40Tkinter 6 make interface 3 entryeuroStr = StringVar()
euroEntry = Entry(root, textvariable = euroStr)
euroEntry.grid(row = 1, column = 2) - 41Tkinter 7 buttons clearclearButton = Button(root, text="Clear", command = onClearF)
clearButton.grid(row = 3, column = 0) - 42Tkinter 7 buttons convertconvertButton = Button(root, text="Convert", command = onConvertF)
convertButton.grid(row = 3, column = 1) - 43Tkinter 8 endroot.mainloop()
- 44Low Level Image Processing 1. import Packageimport math
from PIL import Image, ImageFilter - 45Low Level Image Processing 2. create classclass ImageProcessor:
def __init__(self, w, h):
self.name = "noname.jpg"
self.width = w
self.height = h
self.image = Image.new("RGB", (self.width, self.height)) - 46Low Level Image Processing 3. invert function 1. definedef invert(self, red, green, blue):
newImage = Image.new
("RGB", (self.width, self.height)) - 47Low Level Image Processing 3. invert function 2. traverse pixelsfor i in range(self.width):
for j in range(self.height):
r, g, b = self.image.getpixel((i, j)) - 48Low Level Image Processing 3. invert function 3. change colourif red:
newR = 255 - r
else:
newR = r
newR = 255 - r - 49Low Level Image Processing 4. scale function 1. definedef scale(self, scaleR, scaleG, scaleB):
newImage = Image.new
("RGB", (self.width, self.height)) - 50Low Level Image Processing 4. scale function 2. traverse pixelsfor i in range(self.width):
for j in range(self.height):
r, g, b = self.image.getpixel((i, j)) - 51Low Level Image Processing 4. scale function 3. changenewR = int(r * scaleR)
newG = int(g * scaleG)
newB = int(b * scaleB) - 52Low Level Image Processing 4. scale function 4. new imagenewImage.putpixel((i, j), (newR, newG, newB))
Información
- Descripción
- Computer Science Fichas sobre Graphics Exam, creado por John Ratzinger el 11/12/2018.
- Creado por
- John Ratzinger
- Visitas
- 1
- Historial
-
- Creado por John Ratzinger · 9 dic 2018
- Copiado por John Ratzinger · 9 dic 2018
- Copiado por John Ratzinger · 11 dic 2018
- Valoración