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 & HelpPrograms › Saving as 300 dpi TIFF or .PS files
Page Index Toggle Pages: 1
Saving as 300 dpi TIFF or .PS files (Read 1822 times)
Saving as 300 dpi TIFF or .PS files
May 8th, 2008, 5:01pm
 
I've got a few projects saving as .tiff files, but they're only at 72 dpi and I need at least 300 dpi .tiff or .ps files instead. These are pixel-based drawings, so I'd prefer .ps files for scalability.

Here's the code for one of them.

http://www.divshare.com/download/4451734-be8



Can anyone help with the changes needed to accomplish what I need?


Re: Saving as 300 dpi TIFF or .PS files
Reply #1 - May 18th, 2008, 10:04pm
 
I have just started playing around with Processing so not sure if there is a better method.  However, have you thought about increasing the canvas size by a factor of 4.166 (300 / 72), then using an Image editor.  

Your results with very large canvas sizes may vary.  I have spent a bit of time recently getting an image scaled to print quality.  You might need to allocate more memory to Processing.  

Also rendering parts of the image as tiles may be of interest to you;

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=OpenGL;action=display;num=1159148942;start=11#11



Re: Saving as 300 dpi TIFF or .PS files
Reply #2 - May 18th, 2008, 10:16pm
 
Yes, I tried increasing the size of the canvas by 4.166, then saving a drawing and editing with Photoshop, but that didn't seem to change anything for the better. By the time I got done throwing away all the extraneous background, resizing, and changing the dpi to 300 from 72, I was left with a much smaller file, but as I scaled it up to 100 percent, I could still see the square pixels used  in each line of the drawing; even more so as I made it larger.

Also, the larger the canvas is, the more memory it takes to avoid out of memory errors and the less likely the image is to be drawn in the center, so if you can't see the whole thing, it's hard to know whether or not you should bother saving it.

What I really need is scalability, by saving to a .ps format.
Re: Saving as 300 dpi TIFF or .PS files
Reply #3 - May 18th, 2008, 10:37pm
 
You can save to PDF, and that prints just fine.
Re: Saving as 300 dpi TIFF or .PS files
Reply #4 - May 18th, 2008, 11:00pm
 
As long as it's scalable without any loss of resolution, that works for me.

Can you tell me the exact lines of code to add, and point out where, since I have a number of similarly structured files?
Re: Saving as 300 dpi TIFF or .PS files
Reply #5 - May 18th, 2008, 11:04pm
 
http://processing.org/reference/libraries/pdf/index.html has al the information you need to get PDF export working.
Re: Saving as 300 dpi TIFF or .PS files
Reply #6 - May 18th, 2008, 11:15pm
 
I'm sure that link has the information I need, but since I'm not a programmer, I have no idea how to use it, or where.

But I did notice at the end that it said it saves the information into a PDF at 72 dpi, rather than as a scalable vector. So that suggests that even if I want to scale and print the image, it will always be a 72 dip-based drawing, when I really need a vector-based format.

Is that right, or am I missing something?
Re: Saving as 300 dpi TIFF or .PS files
Reply #7 - May 18th, 2008, 11:24pm
 
It actually saves everything as vectors, except PImages, since they're pixel data originally, and you have to use createFont instead of loadFont to get vector fonts.

It's hard to tell you what to add since it depends on the programs.
Re: Saving as 300 dpi TIFF or .PS files
Reply #8 - May 18th, 2008, 11:31pm
 
If you haven't already, you could download one of the code files which is already setup to save as .tif, then modify it to make it save as PDF instead, with //comments to indicate what you changed.

Since the code files I have are similar, it should work the same on all of them, so I might as well try that first.
Page Index Toggle Pages: 1