Macarena Allendes- mariposa a cuadros-imagen escrita2012
De Casiopea
Título | Mariposa a cuadros |
---|---|
Tipo de Proyecto | Proyecto de Taller |
Palabras Clave | tarea 8 |
Período | 2012- |
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. |
import processing.pdf.*;
PImage imagen; PFont font; String[] code;
float mI = 30; // Margen Izquierda float mAr = 30; // Margen Arriba float mD = 40; // Margen Derecha float mAb = 30; // Margen Abajo float escala;
void setup() {
imagen = loadImage("my_summer.jpg"); size(609, 765); // tamaño carta
float ancho = width - (mI + mD); escala = ancho/imagen.width;
noLoop(); background(255); smooth();
font = createFont("Courier", 12, true); textFont(font, 12); code = loadStrings("trazo.pde"); // cargo el código "trazo" (el pincel)
}
void draw() {
float spacer = 10;
for (int y = 0; y < imagen.height; y += spacer) { for (int x = 0; x < imagen.width; x += spacer) {
// obtengo el color float plotX = map(x, 0, imagen.width, mI, width-mD); float plotY = map(y, 0, imagen.height, mAr, mAr + (imagen.height * escala)); color c = imagen.get(x, y);
trazo(plotX, plotY, c, spacer); } } printCode(); texto();
}
void printCode() {
fill(#707171); // color de la letra float interlinea = 0; for (int i = 0; i < code.length; i++) { // escribo cada línea de código en la pantalla text(code[i], width/16, height/2 + 110 + interlinea); interlinea += 15; }
}
void texto() {
fill(#000000); text("Macarena Allendes", width - mD*5, height - mAb - 20); text("1 Año Diseño", width - mD*5, height - mAb);
} void trazo(float x, float y, color c, float amp) {
int trazos = round(map(brightness(c), 0, 180, 35, 0));
pushMatrix(); { translate(x, y); stroke(c); // color de la imagen pasada al trazo rotate(random(0,2*PI)); // inclinación random strokeWeight(10); // grosor de la línea fill(c); ellipse(amp, 0, amp, 0); // trazo línea } popMatrix();
}