Francisca Romero, Tarea 8 Paisaje, Imagen Escrita

De Casiopea



TítuloFranciscaRomero, tarea 8, Paisaje
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 8
Del CursoImagen Escrita 2012,
CarrerasDiseñ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)Francisca Romero Bugueño
ProfesorHerbert Spencer

/*

Imagen Escrita 2012: Construcción de un trazo (algoritmo pictórico de la luz y el color) 

*/

import processing.pdf.*;

PImage PlayaFrances; PFont font; String[] code;

float margenIzquierda = 30; float margenArriba = 20; float margenDerecha = 20; float margenAbajo = 20; float escala;

void setup() {

 PlayaFrances = loadImage("PlayaFrances.jpg"); 
 size(609, 765, PDF, "Paisaje.pdf"); 
 float ancho = width - (margenIzquierda + margenDerecha);
 escala = ancho/(float)PlayaFrances.width;
 noStroke();
 noLoop(); 
 background(255);
 font = createFont("Courier", 8);
 textFont(font, 8);
 code = loadStrings("trazo.pde");

}


void draw() {

 float spacer =15;
 for (int y = 0; y < PlayaFrances.height; y += spacer) {
   for (int x = 0; x < PlayaFrances.width; x += spacer) {
     float plotX = map(x, 0, PlayaFrances.width, margenIzquierda, width-margenDerecha);
     float plotY = map(y, 0, PlayaFrances.height, margenArriba, margenArriba + (PlayaFrances.height * escala));
     color c = PlayaFrances.get(x, y);
     trazo(plotX, plotY, c, spacer);
   }
 }
 printCode();
 println("----->PDF done!");
 exit();

}

void printCode() {

 float interlinea = 0;
 for (int i = 0; i < code.length; i++) {
   text(code[i], width/4, 2 * margenArriba + PlayaFrances.height * escala + interlinea);
   interlinea += 15;
 }

}


/******************************************************************************/


/* Playa El Francés - Construcción de un trazo*/

void trazo(float x, float y, color c, float random) {

 fill(c);
 ellipse(x, y, map(brightness(c), 100, 255, random, 10), 
 map(brightness(c), 1, 255, random, 70));

}