Render high-res images using Hype Framework

Hi everybody,

I recently started working with Processing in combination with Joshuas’ Hype Framework. I’m able to save single frames from an animation but only in the same resolution as the sketch e.g. 800x500. Is there a way save frames in a higher resolutions especially using Hype?
I found a snippet here on the forum providing a tile based solution but I can not get it running correctly.

HDrawablePool dp2;
HSwarm    swarm;
HTimer    timer;

int scaleValue = 3;  // Multiplication factor
int xoffset = 0;     // x-axis offset 
int yoffset = 0;     // y-axis offset

void setup() {

	swarm = new HSwarm()

	dp2 = new HDrawablePool(500);
	.add(new HEllipse(5))
	// .add(new HRect(2))
	.colorist(new HColorPool(#BFBFBF, #8C8C8C, #404040, #262626, #0D0D0D, #F2F2F2, #BFBFBF, #8C8C8C,#F23E2E).fillOnly())
			new HCallback() {
				public void run(Object obj) {
					int i = dp2.currentIndex();
					HDrawable d = (HDrawable) obj;
						.loc(width/2, height)
						.size((int)random(10,50), (int)random(5,3) )



	timer = new HTimer()
  	.numCycles( dp2.numActive() )
   	new HCallback() {
    	public void run(Object obj) {

void draw() {
  	translate(xoffset * (-width/scaleValue), yoffset * (-height/scaleValue));

void keyPressed(){
        // saveFrame("../frames/#########.tif"); 

void setOffset() {
  save("../frames/lines-" + xoffset + "-" + yoffset + ".jpg");
  if (xoffset == scaleValue) {
    xoffset = 0;
    if (yoffset == scaleValue) {

If anyone could point me in the right direction. Thanks in advance

1 Like

Can you simply use size() to define a different sketch size?

Alternately you could use a PGraphics with any resolution you want and save to it (so, a different graphics buffer from the main sketch canvas). For example, see this previous discussion of HCanvas and getting out the PGraphics.

Hi Jeremy,

thanks for your feedback. I’ve taken a look into it but can’t seem to really understand how the method mentioned in the threat is working with my code.

On a side note I should mentioned that I would like to render a sketch size for later printing purposes. If I would simply change size(800,500) to size(3500,4500) or something even bigger I can kiss my CPU goodbye :wink:

Any idea how to implement it with H.drawStage()?


Is the content of the 3500, 4500 render a single-pass frame, or is it content that would build up on the sketch surface over many frames / seconds / minutes of running?

the animation develops over a period of time e.g. a swarm movement. I currently make use of saveFrame() in combo with a key command for the low resolution renders and hoped that there is a way to render larger images with a similar method.