Blast
def test(a, b, c):
picture = makePicture(pickAFile())
show(picture)
blast(picture, a, b, c)
repaint(picture)
# Increase the red, green and blue values of every pixel
# by different amounts.
# For high values of redFactor, greenFactor, and blueFactor
# and depending on the "modulo pixel values by 256" setting in
# the JES Edit/Options settings, this will either lead to
# the picture going very RGB or having weird psychedelic patches.
# For fun, experiment with different input values and pictures
# that are either very colorful or fairly monochromatic.
#
def blast(pic, redFactor, greenFactor, blueFactor):
for pixel in getPixels(pic):
setRed(pixel, getRed(pixel)*redFactor)
setGreen(pixel, getGreen(pixel)*greenFactor)
setBlue(pixel, getBlue(pixel)*blueFactor)
Links to this Page