home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sources / wanted / 5130 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  2.1 KB

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