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.
IndexProcessing DevelopmentLibraries,  Tool Development › SimplePostscript 0092 (BETA-compliant)
Page Index Toggle Pages: 1
SimplePostscript 0092 (BETA-compliant) (Read 3376 times)
SimplePostscript 0092 (BETA-compliant)
Sep 7th, 2005, 12:08am
 
I've updated the SimplePostscript library to version 0092 as a proper Processing library. Download from http://processing.unlekker.net/SimplePostscript/.
Re: SimplePostscript 0092 (BETA-compliant)
Reply #1 - Sep 7th, 2005, 10:37am
 
Hi marius

I just thought if it wouldn't be a good idea to extend the PGraphics class, so that you have a renderer that you can initialize with:

size(100,100,SimpePostscript);

tex
Re: SimplePostscript 0092 (BETA-compliant)
Reply #2 - Sep 7th, 2005, 12:09pm
 
Hmm, not a bad idea but beyond my time constraints right now. The AIExport library is much more complete and has transparency, so ultimately it will be a better choice for complex graphics. So for now SimplePostscript is meant for just that: Simple PostScript.

Still, it's a cool idea.
Re: SimplePostscript 0092 (BETA-compliant)
Reply #3 - Sep 7th, 2005, 1:33pm
 
this will eventually be the best way to do this sort of thing, i'm still just hashing out how the api for it works (um, size() has to take a filename? weird) and it'll be easier to subclass PGraphics so that it's not too much work.
Re: SimplePostscript 0092 (BETA-compliant)
Reply #4 - Sep 7th, 2005, 8:21pm
 
welcome to beta mr. watz! i'll promote your good work from the site shortly.
Re: SimplePostscript 0092 (BETA-compliant)
Reply #5 - Sep 7th, 2005, 9:17pm
 
Thanks for this.

Is there any way to get transparency support? IE. Is there something I can do myself to get this working?

I am currently using Matt's AIExport library, but am getting out-of-memory errors when I try to render out the pieces. Argh.
Re: SimplePostscript 0092 (BETA-compliant)
Reply #6 - Sep 7th, 2005, 10:09pm
 
Casey: Thanks, it took so little yet so long...

Blprnt: Short answer? No.

Long answer(s): http://en.wikipedia.org/wiki/Transparency_in_graphic_files  http://partners.adobe.com/public/developer/ps/index_specs.html.

Basically, the Wikipedia entry has it right: Alpha (or partial transparency) is not possible in PostScript. It is however possible in PDF or the AI formats. There are tricks you can use, like post-applying transparency in Illustrator, but they're not as flexible as true alpha.

What's great about PostScript is its simplicity, you can get output up and running in minutes. I hear Ben mumbling about PDF, don't know when there'll be official Processing support for that. Haven't looked into it myself, I'm afraid.
Re: SimplePostscript 0092 (BETA-compliant)
Reply #7 - Sep 7th, 2005, 11:11pm
 
blprnt,

a trick i often use is exporting from software without transparency, loading a file into illustrator, and then applying the transparency. this way you can export with the postscript library and can apply the transparency in illustrator by selecting elements with the same stroke or fill color, for example.

casey

Re: SimplePostscript 0092 (BETA-compliant)
Reply #8 - Sep 8th, 2005, 12:16am
 
REAS wrote on Sep 7th, 2005, 11:11pm:
blprnt,

a trick i often use is exporting from software without transparency, loading a file into illustrator, and then applying the transparency. this way you can export with the postscript library and can apply the transparency in illustrator by selecting elements with the same stroke or fill color, for example.

casey



Thanks, Casey. That might actually work pretty well.

In the meantime, I'm trying to figure out this out of memory error I get:

java.lang.outOfMemory

I've been doing some research on this, becuase it seems to happen at about the same time every run, no matter on which computer I'm running it (up to 2GB of RAM).

Some of the documentation I've found suggests using the -Xmx command to change the size of the memory heap. Can you do this from within processing
Re: SimplePostscript 0092 (BETA-compliant)
Reply #9 - Sep 8th, 2005, 2:33am
 
under the heading "Out Of Memory Errors" in the faq:
http://processing.org/faq/bugs.html#memory
Re: SimplePostscript 0092 (BETA-compliant)
Reply #10 - Sep 8th, 2005, 2:46am
 
fry wrote on Sep 8th, 2005, 2:33am:
under the heading "Out Of Memory Errors" in the faq:
http://processing.org/faq/bugs.html#memory


Thanks, Ben.

I apologize for wasting your time by not looking in the FAQ first!!

-Jer
Re: SimplePostscript 0092 (BETA-compliant)
Reply #11 - Oct 24th, 2005, 3:53pm
 

Are there any filesize constraints with PS format? Often when I hit the closefile option I get a list of IOExceptions and a file that's missing the most recent drwing activity.

Any way round this?

(I confess this is the p68 version, as some of my code won't port easily!)
Re: SimplePostscript 0092 (BETA-compliant)
Reply #12 - Oct 25th, 2005, 4:39pm
 
Hi Mark,

There aren't any file size limits in PostScript, you can punish computer with many megabytes of pure vector goodness if you so wish. Most likely you are closing the file and then writing to it afterwards. That will give you IOExceptions every time.

Try isolating the close() command by having a boolean variable called doClose that is set to true when the file should be closed. Then at the end of the draw() loop you check to see if it's true and call close() accordingly.

Also note that there is a variable called isOpen in the SimplePostscript class, you could check that to see whether or not to write to the file.
Page Index Toggle Pages: 1