We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › How to capture high res pictures
Page Index Toggle Pages: 1
How to capture high res pictures? (Read 345 times)
How to capture high res pictures?
Dec 13th, 2006, 3:47pm
 
How would I go about getting for example 300dpi pictures of work done? I need to have pictures to hand in as its a course requirement to have 3 images at 300dpi. I know I can change the applet size but how would I go about getting 300dpi?

This is the source:


int NUM = 15;
boolean myToggle;
Wurm[] w = new Wurm[NUM];


void setup() {
 frameRate(30);
 size(600, 400);
 background(random(0,255),25,180);
 smooth();


 for(int i=0;i<NUM;i++) {
   w[i] = new Wurm(random(width), random(height));
 }

}



void draw() {
 for(int i=0;i<NUM;i++) {
   w[i].draw();
 }
}


class Wurm {

 int wurm_size = 3;             // Width of the centipede
 float xpos, ypos;              // Starting position of centipede
 float xspeed = random(0,2.4);  // Speed of the centipede
 float yspeed = random(0,1.2);  // Speed of the centipede

 float xdirection = random (-1,1);  // Left or Right
 float ydirection = random (-1,1);  // Top to Bottom

 float myAngle = 0;


 Wurm (float theXpos, float theYpos) {
   xpos = theXpos;
   ypos = theYpos;
 }


 void draw() {

   xpos = xpos + ( xspeed * xdirection );
   ypos = ypos + ( yspeed * ydirection );

   if (xpos > width-wurm_size || xpos < 0) {
     xdirection *= -1;

   }
   if (ypos > height-wurm_size || ypos < 0) {
     ydirection *= -1;

   }


/* Draw the centipede */
   myAngle += random(0,0.015f);
   pushMatrix();
   translate(xpos,ypos);
   rotate(myAngle);
   stroke(random(0,1),random(0,2),random(0,3),10);
   line(0, 0,random(-45,-30), random(-45,-30));
   line(0, 0,random(-45,-30), random(-45,-30));
   line(0, 0, -random(-45,-30), random(-45,-30));
   line(0, 0, -random(-45,-30), random(-45,-30));
   popMatrix();

   pushMatrix();
   translate(xpos,ypos);
   rotate(myAngle);
   stroke(random(0,10),random(0,207),random(0,255),20);//stroke colours
 
   line(50, 0,random(-45,30), random(-45,30));
   line(50, 0,random(-45,30), random(-45,30));
   line(50, 0, -random(-45,30), random(-45,30));
   stroke(255,20);
   line(50, 0, -random(-45,30), random(-45,30));
   noStroke();
   fill(255,0,129,10);
   rect(50,50,5,5);
   fill(255,118,0,7);
   ellipse(50,-30,7,3);
   popMatrix();
 }

}


Re: How to capture high res pictures?
Reply #1 - Dec 13th, 2006, 3:59pm
 
What do you mean by 300dpi? Do you mean so that they are the same size, when printed at 300dpi as they are on screen?

It's a bit misleading to just say you want them at 300dpi.
You can just print the picture at 300dpi, and it'll work. It'll be tiny, but it will work.

What dpi it is is defined only by two thing, the pixel size, and how big you print it. If you want to work out the pixel size you need to get 300dpi at the size you want, take the sieze in inches, multiply it by 300, and that's the pixel size you need to make it.

If that's bigger than the screen, you may have to do some more work to get big enough images, but there is some code that will mess with the camera, and give you a bunch of images which you can stick together into a single large image.

Check out this thread for the info: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=OpenGL;action=display;num=1159148942;start=10#10
Page Index Toggle Pages: 1