Valentina Cornejo, tarea 8
De Casiopea
Título | Valentina Cornejo, tarea 8 |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Palabras Clave | tarea 8 |
Período | 2012- |
Asignatura | Imagen Escrita 2012, |
Del Curso | Taller Inicial Común 1ª y 2ª Etapa, |
Carreras | Diseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., Diseño Industrial"Diseño Industrial" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property. |
Alumno(s) | Valentina Cornejo |
Profesor | Herbert Spencer |
import processing.pdf.*; PImage payasito; // la foto: el encuadre, la escena, el paisaje
float margenIzquierda = 30; float margenArriba = 20; float margenDerecha = 20; float margenAbajo = 20; float escala;
void setup() {
payasito = loadImage("payasito.jpg"); // se carga la imagen, se "construye" el objeto PImage payasito size(609, 765, PDF, "payasitoconprosessing.pdf"); // tamaño carta // cálculos para escalar desde la imagen hacia el pincel float ancho = width - (margenIzquierda + margenDerecha); escala = ancho/(float)payasito.width; noStroke(); noLoop(); background(255);
}
void draw() {
float spacer = 2; // muestreo regular desde la foto, esto se puede modificar.... for (int y = 0; y < payasito.height; y += spacer) { for (int x = 0; x < payasito.width; x += spacer) { // obtengo el color float plotX = map(x, 0, payasito.width, margenIzquierda, width-margenDerecha); float plotY = map(y, 0, payasito.height, margenArriba, margenArriba + (payasito.height * escala)); color c = payasito.get(x, y); trazo(plotX, plotY, c, spacer);}} println("----->PDF done!"); exit();
}
- TRAZO******************
void trazo(float x, float y, color c, float amp) {
fill(c); ellipse(x, y, map(brightness(c), 0, 255, amp, 0), map(saturation(c), 0, 255, amp, 0)); ellipse(x, y, map(brightness(c), 100, 0, amp, 0), map(brightness(c), 0, 255, amp, 0));
}