comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Reducing size of vector EPS / PDF output
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Reducing size of vector EPS / PDF output [message #91446] Thu, 16 July 2015 02:39 Go to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Folks,

I draw many glacier outlines on a plot (using old-school graphics and
cgPolygon and stuff). The EPS/PDF output looks great but the file size
is too large (> 6 Mb), simply because the level of precision of my
shapefiles is very high (much higher than necessary for the plot itself).

Do you know of any way to tell IDL's postscript to reduce the precision
of the vectorized output? Or, as a workaround, any external tool that
could do the job?

Thanks,

Fabien
Re: Reducing size of vector EPS / PDF output [message #91456 is a reply to message #91446] Thu, 16 July 2015 11:38 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Thursday, July 16, 2015 at 5:39:23 AM UTC-4, Fabien wrote:
> Folks,
>
> I draw many glacier outlines on a plot (using old-school graphics and
> cgPolygon and stuff). The EPS/PDF output looks great but the file size
> is too large (> 6 Mb), simply because the level of precision of my
> shapefiles is very high (much higher than necessary for the plot itself).
>
> Do you know of any way to tell IDL's postscript to reduce the precision
> of the vectorized output? Or, as a workaround, any external tool that
> could do the job?

Probable the most portable way to do it, is convert to PDF. PDF includes compression.
Re: Reducing size of vector EPS / PDF output [message #91464 is a reply to message #91446] Thu, 16 July 2015 18:53 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Fabien writes:

> I draw many glacier outlines on a plot (using old-school graphics and
> cgPolygon and stuff). The EPS/PDF output looks great but the file size
> is too large (> 6 Mb), simply because the level of precision of my
> shapefiles is very high (much higher than necessary for the plot itself).
>
> Do you know of any way to tell IDL's postscript to reduce the precision
> of the vectorized output? Or, as a workaround, any external tool that
> could do the job?

I've done this before to make lower resolution shape files. I don't
remember the details, exactly, but I think I used the always-useful
ArcSample program in the Coyote Library to sample the polygon at
approximately equally space intervals.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Reducing size of vector EPS / PDF output [message #91466 is a reply to message #91456] Fri, 17 July 2015 01:54 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
On 07/16/2015 08:38 PM, Craig Markwardt wrote:
>> Do you know of any way to tell IDL's postscript to reduce the precision
>>> of the vectorized output? Or, as a workaround, any external tool that
>>> could do the job?
> Probable the most portable way to do it, is convert to PDF. PDF includes compression.
>

Hi Craig,

thanks! I forgot to mention that the eps file is 22Mb large, and PDF
manages to reduce it to a more handable 6Mb.

I guess I have no other way as suggested by David: reduce the precision
of my vectors *before* plotting. sigh...

Fabien
Re: Reducing size of vector EPS / PDF output [message #91467 is a reply to message #91464] Fri, 17 July 2015 02:19 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
On 07/17/2015 03:53 AM, David Fanning wrote:
> I've done this before to make lower resolution shape files. I don't
> remember the details, exactly, but I think I used the always-useful
> ArcSample program in the Coyote Library to sample the polygon at
> approximately equally space intervals.

Ha! Thanks, David. The code is quite crytpic to me (3 calls to
spl_interp!?), but it works and makes beautiful curves ;-)

Cheers,

Fabien
Re: Reducing size of vector EPS / PDF output [message #91469 is a reply to message #91467] Fri, 17 July 2015 05:59 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Fabien writes:

> Ha! Thanks, David. The code is quite crytpic to me (3 calls to
> spl_interp!?), but it works and makes beautiful curves ;-)

I don't understand it either. Craig wrote it for me. I do know it has
been one of the most useful utility routines in the Coyote Library for
me. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Reducing size of vector EPS / PDF output [message #91470 is a reply to message #91469] Fri, 17 July 2015 06:31 Go to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
On 07/17/2015 02:59 PM, David Fanning wrote:
>>> Ha! Thanks, David. The code is quite crytpic to me (3 calls to
>>> spl_interp!?), but it works and makes beautiful curves;-)
> I don't understand it either. Craig wrote it for me. I do know it has
> been one of the most useful utility routines in the Coyote Library for
> me.:-)


It seems to be quite close to SPLINE_P, I just found out. Howver, with
SPLINE_P you have to estimate the tangent at the junction point by
yourself. See the following example:

pro test_curvature

x = [0.5, 1.5, 1.5, 0.5, 0.5]
y = [0.3, 0.3, 1.3, 1.3, 0.3]

ArcSample, x, y, xas, yas
spline_p, x, y, xsp, ysp
t = [1., -1]
spline_p, x, y, xsp2, ysp2, TAN0=t, TAN1=t

cgPlot, [0, 2], [0, 2], /NODATA, /WINDOW
cgPlots, x, y, color='black', /WINDOW
cgPlots, xas, yas, color='red6', /WINDOW
cgPlots, xsp, ysp, color='blu6', /WINDOW
cgPlots, xsp2, ysp2, color='blu4', /WINDOW
cgLegend, Titles=['ArcSample', 'spline_p', 'spline_p tangent'], $
LINESTYLES=[0,0,0], COLORS=['red6', 'blu6', 'blu4'], $
/ADDCMD, LOCATION=[0.2, 1.8], /DATA

end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: thresholding image
Next Topic: Creating a legend on graphs in postscript, and maps

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:44:26 PDT 2025

Total time taken to generate the page: 0.00479 seconds