Example of looping over pixels and identifying certain color values to change. This example requires the caterpillar image from the media resource and media.py be in the same directory as this code to run the program
import media
filename = 'caterpillar.jpg'
picture = media.makePicture(filename)
media.explore(picture)
pixels = media.getPixels(picture)
for pixel in pixels:
if media.getRed(pixel) >= 200 and media.getGreen(pixel) >= 200 and media.getBlue(pixel) < 10:
media.setColor(pixel, media.magenta)
media.show(picture)
media.quit()