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.
Page Index Toggle Pages: 1
High Res Images (Read 692 times)
High Res Images
Feb 6th, 2006, 7:43pm
 
Hi there !

Is there any possibilities to render and save an image in high resolution (300 dpi) and in an appropriate format like .jpg .tiff or something else ?

Thanks a lot.
Re: High Res Images
Reply #1 - Feb 7th, 2006, 3:14pm
 
hi... only because an image is saved in 300dpi doesn't make it automatically hi-res. DPI is a virtual measure and only useful for print purposes. even the 72dpi used for "screen resolution images" is misleading since display resolutions these days have somewhat come along since that term has been coined. for example my screen res on laptop is 128dpi, while  the same number of pixels on my iMac are only 99dpi... Code:
println(dist(0,0,1680,1050)/15.4); // 128.64
println(dist(0,0,1680,1050)/20); // 99.05

so what constitutes high resolution for bitmaps is purely down to the number of pixels used for an image. simply increase the size of your sketch or use the new built in PDF export feature or one of the other vector format export libraries for infinite resolution.

hth!
Re: High Res Images
Reply #2 - Feb 7th, 2006, 10:12pm
 
Hum
by Hi Res I wanted to say : "printable"...

I'm a beginner in Processing and code, so can you just explain me what the line code say ?
Thanks a lot.

I tried to increase the size of my sketches...but I only can save it in an java format... or did I forget something ?

As to the vector format export libraries, I took them but I don't really understand how it works !
Anyway, I'll try to cope with these problems...

thx
Re: High Res Images
Reply #3 - Feb 8th, 2006, 11:22am
 
Hey tintin,

no worries - am not sure what you mean with "but I only can save it in an java format" - you can use the saveFrame() to export an image as TIFF or TGA...

the 2 lines of code were purely to demonstrate how I arrived at the DPI settings for my 2 displays (both at 1680x1050).

println(dist(0,0,1680,1050)/15.4) taken apart means:

* calculate the diagonal number of pixels of the display (dist() is the same as pythagoras)

* then we divide the result by the physical size of the display (in inches) to get the resolution in dots-per-inch...

* println() prints out the final result in the console
Re: High Res Images
Reply #4 - Feb 8th, 2006, 1:29pm
 
Hum well...
Can we make a step by step answear ? Sorry for that, I'm a very beginner.

Ok.
Imagine, I want to make a Sketch, which size would be A3 for example (29.7 cm x 42 cm) and in 300dpi (or in other words, printable). What would be the code to use, in addition to the code we already have to make the sketch, and to be able to save this sketch in tiff or tga in a printable resolution ?

Sorry for the inconvenient.
Thx
Re: High Res Images
Reply #5 - Feb 8th, 2006, 3:49pm
 
If you put the following code into Processing and run it, then click on the applet and press a key - an image will be saved in that sketch's folder.
Code:

//testing how to save an image
int wide = 100;
int high = 100;
void setup(){
size(wide, high);
}
void draw(){
rect(10,10,20,20);
}
void keyPressed(){
saveFrame();
}

Now if you want 300 dots per inch, that's like 300 pixels per inch. So you need to do some simple multiplication. There are 2.54cm to the inch by the way. So for the width of the image the formula would be:

(width_in_centimeters / 2.54) * 300

As a hint, Photoshop will use 49.8 megabytes making an A3 image at 300 dpi
Re: High Res Images
Reply #6 - Feb 9th, 2006, 10:21am
 
Thanks a lot for that.
I'll try it and keep in touch for the results.

Many Thanks.
Page Index Toggle Pages: 1