Manipulating Images by the Pixels
Back to Picture ProcessingAuthor: Zsófia Ruttkay Version: 1.0 Date: 25.10.2010
Loading an image
load_image
Load an image stored in the /data folder. Check how the size of the canvas and size of the image differ. | PImage, loadImage(), image(img,0,0) size(), setup(), draw() | |
load_image_1
Load two images, at different locations, scaled | image(img,x, y, sizex, sizey) | |
load_image_2
Load two images, at locations and scaled according to the position of the mosue. | mosueX, mouseY | |
load_image_3
Display an image each time at an incremented position. Experiment with different increments. See what background() does. | background() | |
load_image_4
Display an image at the mouse position Modify the code such that the size gets also changed. | | |
swap_images
Show images randomly on mouse press. | mousePressed(), random() | |
sequence_images
Show images automatically in a sequence. How would you control the speed? | PImage[] images = new PImage[maxImages]; |
Pixels
set_pixels
Set pixels to random colors | loadPixels(),updatePixels(), pixels[i] = c noLoop(), loop(), | |
sample_pixels
Sample pixels at mouse location & FAST WAY to reach color of a pixel | loc = mouseX + mouseY*width; c = img.pixels[loc]; | |
pointillize
Draw circles at random locations, according to colors of the image | | |
pointillize_3
As before, but draw many points at a time at random locations. How to stop the fimal floating animaition effect? | for() | |
pointillize_1
Draw squares at grid locations, according to colors of the image | | |
brighten_pixels_1
Brighten up image in a circle around mouse | | |
brighten_pixels_2
Erase the dark cover from the image - actually brighten up the trace of the mouse. | | |
brighten_pixels_3
Turn image B&W according to brightness threshold. | |