Manipulating Images by the Pixels

Back to Picture Processing
Author: Zsófia Ruttkay Version: 1.0 Date: 25.10.2010

Loading an image

ImageProcessingWs/load_image/data/narcis.jpg 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()
ImageProcessingWs/load_image_1/screenshot.jpg load_image_1
Load two images, at different locations, scaled
image(img,x, y, sizex, sizey)
ImageProcessingWs/load_image_2/screenshot.jpg load_image_2
Load two images, at locations and scaled according to the position of the mosue.
mosueX, mouseY
ImageProcessingWs/load_image_3/screenshot.jpg load_image_3
Display an image each time at an incremented position.
Experiment with different increments.
See what background() does.
ImageProcessingWs/load_image_4/screenshot.jpg load_image_4
Display an image at the mouse position
Modify the code such that the size gets also changed.

ImageProcessingWs/swap_images/screenshot.jpg swap_images
Show images randomly on mouse press.
mousePressed(), random()
ImageProcessingWs/sequence_images/screenshot.jpg sequence_images
Show images automatically in a sequence.
How would you control the speed?
PImage[] images = new PImage[maxImages];


ImageProcessingWs/set_pixels/screenshot.jpg set_pixels
Set pixels to random colors
loadPixels(),updatePixels(), pixels[i] = c
noLoop(), loop(),
ImageProcessingWs/sample_pixels/screenshot.jpg sample_pixels
Sample pixels at mouse location & FAST WAY to reach color of a pixel
loc = mouseX + mouseY*width;
c = img.pixels[loc];
ImageProcessingWs/pointillize/screenshot.jpg pointillize
Draw circles at random locations, according to colors of the image

ImageProcessingWs/pointillize_3/screenshot.jpg pointillize_3
As before, but draw many points at a time at random locations.
How to stop the fimal floating animaition effect?
ImageProcessingWs/pointillize_1/screenshot.jpg pointillize_1
Draw squares at grid locations, according to colors of the image

ImageProcessingWs/brighten_pixels_1/screenshot.jpg brighten_pixels_1
Brighten up image in a circle around mouse

ImageProcessingWs/brighten_pixels_2/screenshot.jpg brighten_pixels_2
Erase the dark cover from the image - actually brighten up the trace of the mouse.

ImageProcessingWs/brighten_pixels_3/screenshot.jpg brighten_pixels_3
Turn image B&W according to brightness threshold.