Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

more efficient PS output from Maple

2 views
Skip to first unread message

Colin Rowat

unread,
Nov 20, 2009, 5:04:03 AM11/20/09
to
I have been outputting as postscript 3d plot structures from Maple
(11.02, for Win XP). These tend to be large (c. 6MB). I have
therefore wondered whether they are still trying to preserve the 3d
information "under" the visible plane. If so, is there any way of
suppressing this to obtain smaller PS output?

Other output formats (e.g. PNG) are much smaller, but I wish to retain
the vector information, as my ultimate aim is to convert the graphic
to a LaTeX compilable format, such as PGF/TikZ.

Thank you in advance,

Colin Rowat

RedGrittyBrick

unread,
Nov 20, 2009, 5:29:59 AM11/20/09
to

Colin Rowat wrote:
> I have been outputting as postscript 3d plot structures from Maple
> (11.02, for Win XP). These tend to be large (c. 6MB). I have
> therefore wondered whether they are still trying to preserve the 3d
> information "under" the visible plane. If so, is there any way of
> suppressing this to obtain smaller PS output?

Suppression would be something you'd select in Maple wouldn't it? That
would be a question for a Maple support forum.

If you want to remove extraneous material from the Postscript file
*after* it has been produced by Maple, it might be possible. I'd inspect
the produced Postscript using a text editor and then write a program (I
usually use Perl, but sometimes a good text editor suffices) to remove
the unwanted parts. I have done this in the past to reduce the size of
Postscript files. For example, by reducing the precision of coordinates
from e.g. ten significant digits to four.

> Other output formats (e.g. PNG) are much smaller, but I wish to retain
> the vector information, as my ultimate aim is to convert the graphic
> to a LaTeX compilable format, such as PGF/TikZ.

Does Maple support SVG? Maybe you could try that and compare the size of
the resultant file.

--
RGB

Colin Rowat

unread,
Nov 20, 2009, 6:46:00 AM11/20/09
to
Thanks RGB.

> Suppression would be something you'd select in Maple wouldn't it? That
> would be a question for a Maple support forum.

As yet, I've been unable to find any 'suppression' options via Maple,
but I am looking into this further.

> If you want to remove extraneous material from the Postscript file
> *after* it has been produced by Maple, it might be possible. I'd inspect
> the produced Postscript using a text editor and then write a program (I
> usually use Perl, but sometimes a good text editor suffices) to remove
> the unwanted parts. I have done this in the past to reduce the size of
> Postscript files. For example, by reducing the precision of coordinates
> from e.g. ten significant digits to four.

The eps2pgf conversion currently increases my file size by a factor of
10 (thus, to c. 60MB). Thus, while I might be able to make marginal
improvements in Postscript, I don't think that I'm skilled enough to
cut it down as seriously as I need.

> Does Maple support SVG? Maybe you could try that and compare the size of
> the resultant file.

Maple does not currently support SVG - it's on users' wish list,
though (q.v. http://www.mapleprimes.com/blog/acer/pollchangemapleyouwantmost).
I can, of course, convert from EPS to SVG (and then to PGF/TikZ with
inkscape2tikz), but don't know how reliable this is, or if this would
bring about the sort of size improvements that I need.

Again, thank you,

Colin

abe...@hotmail.com

unread,
Nov 20, 2009, 8:27:22 AM11/20/09
to

Have you tried converting to PDF via Distiller or GhostScript?

Ed


Colin Rowat

unread,
Nov 20, 2009, 8:53:52 AM11/20/09
to
> Have you tried converting to PDF via Distiller or GhostScript?

Thanks Ed. I can do that, and do get a smaller file than the PS (c.
2MB). Once I've got the PDF file, though, I'm still left with the
same problem of trying to make it (and especially its fonts) look
LaTeX compatible.

Best,

Colin

John Reiser

unread,
Nov 20, 2009, 10:52:01 AM11/20/09
to

Coverting .ps to .pdf removes much that is not required to make marks
(apply ink to the page.) Then convert .pdf to .ps (for example, pdf2ps
from Ghostscript) to get something that can be edited. Then edit the
file, or write your own definitions of PostScript primitives that are
used by the 2nd-generation .ps file, to parse and translate into input
that is suitable for LaTeX.

--

Colin Rowat

unread,
Nov 20, 2009, 12:08:53 PM11/20/09
to
> Coverting .ps to .pdf removes much that is not required to make marks
> (apply ink to the page.)  Then convert .pdf to .ps (for example, pdf2ps
> from Ghostscript) to get something that can be edited.  Then edit the
> file, or write your own definitions of PostScript primitives that are
> used by the 2nd-generation .ps file, to parse and translate into input
> that is suitable for LaTeX.

Thanks John. I've just converted my 2MB PDF file back into PS, both
by using pswrite inside Ghostview, and by using pdf2ps from a DOS
box. In both cases, the output is about 12MB, much larger than my
original 7MB PS file. I've not used pdf2ps before, so there may be
compression options that I'm not aware of.

Best,

Colin

ThomasW

unread,
Nov 20, 2009, 2:49:50 PM11/20/09
to
On 20 Nov., 11:04, Colin Rowat <c.ro...@espero.org.uk> wrote:
> I have been outputting as postscript 3d plot structures from Maple
> (11.02, for Win XP).  These tend to be large (c. 6MB).  I have
> therefore wondered whether they are still trying to preserve the 3d
> information "under" the visible plane.  If so, is there any way of
> suppressing this to obtain smaller PS output?
>

Here is a thread that discusses exactly this topic:

http://groups.google.com/group/comp.lang.postscript/browse_thread/thread/6e7b47e66f5ef784

Gernot Hoffmann gave all theoretically possible algorithms for the
task. The final pragmatic solution however was to raster the plot and
re-vectorize it. That's certainly quicker than writing a program for
the task or removing the invisible parts by hand in Adobe Illustrator
or Inkscape.

Thomas W.

Colin Rowat

unread,
Nov 20, 2009, 5:59:17 PM11/20/09
to
> Here is a thread that discusses exactly this topic:
>
> http://groups.google.com/group/comp.lang.postscript/browse_thread/thr...

>
> Gernot Hoffmann gave all theoretically possible algorithms for the
> task.  The final pragmatic solution however was to raster the plot and
> re-vectorize it.  That's certainly quicker than writing a program for
> the task or removing the invisible parts by hand in Adobe Illustrator
> or Inkscape.

Thank you Thomas - this does the trick. To re-vectorise, I don't have
Adobe Illustrator, so have used the online version of Vector Magic.
This creates a 200kb EPS file - very manageable - but does blur some
details which I'll have to clean up by hand. Again, though, that
seems manageable.

Best, and thank you again,

Colin

0 new messages