home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sources.wanted:5130 comp.graphics:12238
- Newsgroups: comp.sources.wanted,comp.graphics
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!convex!nrc.com!kosman!kevin
- From: kevin@kosman.uucp (Kevin O'Gorman)
- Subject: Re: Postscript optimization
- Message-ID: <1992Nov22.183507.12633@kosman.uucp>
- Keywords: postscript,bitmap,compression
- Organization: Vital Software Services, Oxnard, CA
- References: <166@denali.UUCP>
- Date: Sun, 22 Nov 1992 18:35:07 GMT
- Lines: 40
-
- steve@denali (steve) writes:
-
- >Does anyone know a way to reduce the size of huge postscript image
- >files? Our application produces only bitmaps for shaded output which
- >can be several megabytes in size. Print time can be hours, with the
- >biggest delay being time to send through the parallel port.
-
- >I'd like to optimize the file, perhaps by finding areas of nearly the
- >same color or intensity and polygonalizing them.
-
- You could do that, though it would be a fairly big job, I think.
-
- Postscript level 2 has several things that help, but even in Level 1,
- I've seen approaches that help a lot with this sort of thing.
-
- The usual thing you see before optimization is like this (from the
- Red Book version 1):
-
- /picstr 256 string def
- ...
-
- ... {currentfile picstr readhexstring pop} image
- [ ... lots of hex bytes, mostly identical ... ]
-
- The idea is to use a smarter proc before the image operator, and to
- compress the identical bytes. Perhaps the simplest approach is to
- alternate repeated and non-repeated bytes, and prefix each group
- with the length of the run. Then repeated bytes become just
- <count><byte>
- And non-repeated groups become one byte longer (for the non-repeat
- run length). If your repeats are really long, you might use more than
- a one-byte repeat count. You can use other similar ideas, too.
-
- Then you write a processor on the sending system to squash your images
- before sending them to the printer.
-
- --
- Kevin O'Gorman ( kevin@kosman.UUCP, kevin%kosman.uucp@nrc.com )
- voice: 805-984-8042 Vital Computer Systems, 5115 Beachcomber, Oxnard, CA 93035
- Non-Disclaimer: my boss is me, and he stands behind everything I say.
-