Trazo

De Casiopea
Revisión del 01:52 12 jul 2013 de Cesarhenriquez (discusión | contribs.) (Página creada con «{{Proyecto |Título=Trazo de imagen |Tipo de Proyecto=Proyecto de Curso |Palabras Clave=Tarea 08 |Año de Inicio=2013 |Carreras Relacionadas=Arquitectura |Asignaturas Relac...»)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)
Trazo de imagen


TítuloTrazo de imagen
Tipo de ProyectoProyecto de Curso
Palabras ClaveTarea 08
Período2013-
Asignatura1º ARQ,
Del CursoImagen Escrita 2013 - ARQ,
CarrerasArquitectura
Alumno(s)César Henríquez
ProfesorHelbert Spencer

PImage img;
int pointillize = 16;

void setup() {
  size(500,333);
  img = loadImage("acropolis.jpg");
  background(255);
  smooth();
}

void draw() {
  
  // Pick a random point
  int x = int(random(img.width));
  int y = int(random(img.height));
  int loc = x + y*img.width;
  
  // Look up the RGB color in the source image
  loadPixels();
  float r = red(img.pixels[loc]);
  float g = green(img.pixels[loc]);
  float b = blue(img.pixels[loc]);
  
  // Back to shapes! Instead of setting a pixel, we use the color from a pixel to draw a circle.
  noStroke();
  fill(r,g,b,100);
  ellipse(x,y,pointillize,pointillize); 
}