Valentina Villegas Tarea8

De Casiopea


TítuloValentina Villegas Tarea8
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 8
Período2012-
AsignaturaImagen Escrita, Imagen Escrita 2012,
Del CursoImagen Escrita 2012, Taller Inicial Común 1ª y 2ª Etapa,
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)Valentina Villegas
ProfesorHerbert Spencer

import processing.pdf.*;

PImage leerimagen; PFont letra; String[] pincelada;


float marriba = 56.7; float mizquierda = 42.5; float mderecha = 42.5; float mabajo = 56.7; float modificar;

void setup() {

leerimagen = loadImage("imagen.jpg");  
size (609, 765, PDF, "exportarimagen.pdf"); 
float ancho = width - (mizquierda + mderecha); 
modificar = ancho/(float)leerimagen.width; 

noStroke();
noLoop();
background(255);

letra = createFont ("courier", 9);  
textFont(letra, 9);

pincelada = loadStrings("trazo.pde"); 

}

void draw () {

colorMode(RGB);
float spacer = 8;   
for (int x=0; x < leerimagen.width; x += spacer)  
{
  for (int y=0; y < leerimagen.height; y += spacer)
  {
    float modifX = map (x, 0, leerimagen.width, mizquierda, width-mderecha);
    float modifY = map (y, 0, leerimagen.height, marriba, marriba + (leerimagen.height * modificar));
    color c = leerimagen.get (x, y);
 
    trazo(modifX, modifY, c, spacer);

  }
}



leerelPDF();
println("PDF realizado");
exit(); 

}


void leerelPDF() {

fill(0);
float interlin = 0;
for (int w = 0; w < pincelada.length; w++)
{
  text (pincelada[w], mizquierda*2, 2 * marriba + leerimagen.height * modificar + interlin);
  interlin += 11;
}

}


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

 fill (c);
 // invierte la saturación
float r=255-saturation(c);
 stroke(r);
   rect(x, y, 4,4);}