Save High resolution images/vector without aliasing

Hello, :) I really need help or suggestions for saving a hires image, I've been trying many solutions online to figure out this issue with no luck :( Code is simple, It's concentric circles but when saved as a pdf - circles look rasterized. Below is a snapshot of the pdf i saved. snapshot

import processing.pdf.*;

PVector[] circle = new PVector[360];
float translate_z = 0;
float radius = 200;

void setup(){
  size(1024,512, PDF, "hires.pdf");
  background(0);
  noFill();
  smooth();

  translate_z=0.8;
}

void draw(){
  translate_z += 0.01;
  if(translate_z > 1.5)    exit();
  translate(width/2, height/2);
  scale(1/translate_z);
  translate(-width/2, -height/2);

  radius-=0.5;
  for(int angle=0; angle < 360; angle += 1){
    float x = width/2 + radius*cos(radians(angle));
    float y = height/2 + radius*sin(radians(angle));
    circle[angle] = new PVector(x,y);  
  }

  noFill();
  stroke(255,50);
  strokeWeight(0.1);
  drawCircle(circle);
}

void drawCircle(PVector[] circle){
   beginShape();
   for(int angle=0; angle < 360; angle+= 1){
     curveVertex(circle[angle].x, circle[angle].y);
   }
   endShape(CLOSE);
}

Infact I'm really inspired by zenbullets work - http://zenbullets.com/prints/everypuddlegasolinerainbow.php Trying for a similar effect and resolution of the saved image.(I've been starring at this image for about a week infact. :P)

Things I've tried(without any luck): 1. Changing simple stuff i.e strokeWeight, stroke color w/ transparency, 2. calculating upto 3600 points for a each of the circle. 3. save as pdf with size 10240x5120. 4. Saving as a png with TileSaver

Thanks in advance. :)

-Mike

Answers

  • circles look rasterized

    that looks ok here.

    seen at normal size it looks a bit odd because it has to scale it all the way down for the screen and, yes, it uses pixels. but zoom in, like 1200%, and you can see all the lines are smooth as i'd expect.

  • Thanks for the reply koogs :) That's my question - How can i make it not look rasterized/scaled at 100% zoom level? Art forms http://zenbullets.com/prints.php by matt pearson's zenbullets have a really high resolution but, they don't look rasterized at 100% zoom!!! I'm hoping to get that level of quality...even if i have to post-process the output.

    Thanks again! :)

    -Mike

  • I think you have a problem with your terminology: rasterize is what happens when you generate a bitmap image - as you are doing here - so it's not a problem. I suspect what you don't like is the moiré effect you're seeing. When I look at the rendered/rasterized image I see this at the poles - i.e. north/south/east/west.

    Notice that the zenbullets example doesn't have uniformly parallel lines. Also notice fairly heavy blur on each line...

    I suspect there's plenty of documentation online on how to mitigate against this effect. A similar issue occurs when you create linear gradients: noticeable 'bars' appears no matter how smooth you make the gradient. One common fix is to add some random noise across the whole image. That might work here...

Sign In or Register to comment.