Image
Loading & Displaying
Pixels
Example
from processing import *
pikachu = None
ball = None
def setup():
global pikachu, ball
size(400, 400)
colorMode(RGB, 100)
# you may want to change the image url below
pikachu = loadImage("http://www.avatars101.com/avatars/Pokemon/301BE8845F43838DE7A6B6DFEB2B963E/Pikachu.gif")
ball = requestImage("http://vignette4.wikia.nocookie.net/pokemon/images/4/46/Timer_Ball.png")
def draw():
background(0, 200, 200)
image(pikachu, 100, 100)
if ball.width != 0 and ball.width != -1:
image(ball, 200, 50, 65, 65)
run()
Reference