stocht.ps 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. % Copyright (C) 1999, 2000 Aladdin Enterprises. All rights reserved.
  2. %
  3. % This file is part of AFPL Ghostscript.
  4. %
  5. % AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  6. % distributor accepts any responsibility for the consequences of using it, or
  7. % for whether it serves any particular purpose or works at all, unless he or
  8. % she says so in writing. Refer to the Aladdin Free Public License (the
  9. % "License") for full details.
  10. %
  11. % Every copy of AFPL Ghostscript must include a copy of the License, normally
  12. % in a plain ASCII text file named PUBLIC. The License grants you the right
  13. % to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14. % conditions described in the License. Among other things, the License
  15. % requires that the copyright notice and this notice be preserved on all
  16. % copies.
  17. % $Id: stocht.ps,v 1.3 2000/09/19 18:29:11 lpd Exp $
  18. % helper file to simplify use of Stochastic Halftone - uses ht_ccsto.ps
  19. % This file sets the /StochasticDefault /Halftone as the current
  20. % and the /Default halftoning, loading the Stochastic halftone
  21. % if required.
  22. % Stochastic halftoning is recommended for inkjet printers, and may
  23. % produce output as pleasing as the more computationally expensive
  24. % "error diffusion" that *some* device drivers provide.
  25. % For printing technologies other than inkjet, Stochastic halftoning
  26. % may not look better than standard screening. In particular, thermal
  27. % transfer and direct thermal tend to be better with standard ordered
  28. % screening methods. Some laser printers may produce "smoother"
  29. % looking gray shades with Stochastic halftoning. Try it, and if
  30. % you like it, use it.
  31. % Note that this /Default halftone can be overridden by PostScript
  32. % operators that set the screening or halftone (such as setscreen).
  33. % To make Stochastic Halftone be "sticky" so that other screening and
  34. % halftone setting in the subsequent PostScript will be ignored, use:
  35. % -c "<< /HalftoneMode 1 >> setuserparams"
  36. % on the command line prior to the file to be processed. For example,
  37. %
  38. % gs stocht.ps -c "<< /HalftoneMode 1 >> setuserparams" -f examples/tiger.ps
  39. % Alternatively, the command to set the /HalftoneMode userparam can be
  40. % concatenated to this file (see below).
  41. % =====================================================================
  42. % Try to get the previously defined resource
  43. { /StochasticDefault /Halftone findresource } stopped
  44. {
  45. pop pop
  46. % Need to load the Stochastic Halftone using the lib file
  47. (ht_ccsto.ps) runlibfile
  48. } if
  49. % If we didn't error out by now, then go ahead and define the /Default
  50. /StochasticDefault /Halftone findresource
  51. /Default exch /Halftone defineresource
  52. sethalftone % Use the halftone
  53. % Uncomment the next line to make the Stocahstic halftoning be "sticky"
  54. % << /HalftoneMode 1 >> setuserparams