We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Exporting in high resolution makes my sketch look completely different. I'm using PGraphics and I wonder how this could affect my sketch. I have no idea why it changed the color of my stuff and remove the alpha channel. I guess is because because PGraphics can't interact with sketch's background. If I am right, how can made this alpha gradient trails in PGraphics?
import processing.pdf.*;
float size = 1;
float z = 0.0;
float z2 = 20.0;
float z3 = 30.0;
PFont myFont;
int offset = 10;
void setup(){
size(413,945,P3D);
background(10);
pixelDensity(displayDensity());
colorMode(HSB, height,300,360);
noStroke();
myFont = createFont("bmd Neuzeit Grotesk T Regular.ttf", 10);
textFont(myFont);
textAlign(CENTER, CENTER);
}
void drawGrid(PGraphics pg){
pg.fill(0,20);
pg.rect(0,0,width, height);
String[] chars = split("b m d b m d m", ' ');
for ( int x = -width/2; x < width + width/2; x +=offset){
for ( int y = -height/2; y < height + height/2; y += offset){
int nl = (int) map(noise(z, x / 550.0, y / 550.0), 0, 1, 0, 7);
float ns = map(noise(z, x / 550.0, y / 550.0), 0, 1, 0, 3);
pg.fill(0,0,350);
pg.pushMatrix();
if ((y - 16) % (2) == 0){
pg.scale(ns);
pg.text(chars[nl], x,y );}
else{
pg.text(chars[nl], x + 8 ,y);
}
pg.popMatrix();
}
}
z = z + .003;
}
void draw() {
drawGrid(this.g);
}
void keyPressed(){
if (key == 's') {
save("normal.png");
hf(6);
exit();
}
}
void hf(int saveScale){
PGraphics pg = createGraphics(int(width*saveScale), int(height*saveScale), PDF, "output.pdf");
pg.beginDraw();
pg.scale(saveScale);
drawGrid(pg);
pg.dispose();
pg.endDraw();
}
Answers
G_D thank you! but It is still missing opacity trails.
Here is what I am trying to get:
And this is what I get: