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 › saving frame other than TIF
Page Index Toggle Pages: 1
saving frame other than TIF (Read 1176 times)
saving frame other than TIF
Aug 5th, 2007, 9:37pm
 
Hi,

How do you save a frame in a format other than tif?

The reference is unclear and contradictory.

It says "It is possible to [...] make the choice of saving TIFF, TARGA, PNG, or JPEG files with the ext parameter"
but there's no ext parameter: saveFrame only takes one parameter which is the file name.

I tried with:
saveFrame("something.jpg");

but the image was saved as something.jpg.tif and was actually a tif.
Same thing with gif and png.

Oh, Windows XP here.
Re: saving frame other than TIF
Reply #1 - Aug 14th, 2007, 6:56pm
 
http://processing.org/reference/saveFrame_.html

saveFrame("frame_#####.png");

the #s will be replaced with the frame index
Re: saving frame other than TIF
Reply #2 - Aug 14th, 2007, 7:23pm
 
koogy wrote on Aug 14th, 2007, 6:56pm:
http://processing.org/reference/saveFrame_.html

saveFrame("frame_#####.png");

the #s will be replaced with the frame index


Already tried that out, didn't work.
Maybe I used the wrong number of "#"s, I'll try it again with 5 #s.


Re: saving frame other than TIF
Reply #3 - Aug 14th, 2007, 7:31pm
 
No, it doesn't work, the file is saved as "frame_0000.png.tif" and it is a tif.

I am using saveFrame() in the "setup" method, not in the "draw" method, since I only want to save one frame.

However, I tried putting the saveFrame within the draw() method, and it doesn't work either (saves files as frame_00000.png.tif, frame_00001.png.tif, etc), all tifs.
Re: saving frame other than TIF
Reply #4 - Aug 14th, 2007, 7:37pm
 
odd, i was using it last night and it was fine.

was using 0125 and linux.

(the 5 #s just mean i can generate more than 9999 frames, 4 should work just as well)
Re: saving frame other than TIF
Reply #5 - Aug 14th, 2007, 7:44pm
 
just tried it again with the following on 0125 and WinXP

size(200, 200);
background(0);
stroke(255);
noFill();
smooth();

for(int i = 0; i < 100; i += 20) {
 bezier(90-(i/2.0), 20+i, 210, 10, 220, 150, 120-(i/8.0), 150+(i/4.0));
}

saveFrame("frame.png");

and it was fine, saved a png.
Re: saving frame other than TIF
Reply #6 - Aug 15th, 2007, 11:10pm
 
matteo.sistisette wrote on Aug 14th, 2007, 7:31pm:
No, it doesn't work, the file is saved as "frame_0000.png.tif" and it is a tif.

what platform are you on, and what version of java are you using

if you're using java 1.3, you can't save png and jpg images, only tif and tga files.
Page Index Toggle Pages: 1