stocht.ps 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. % Copyright (C) 1999, 2000 artofcode LLC. All rights reserved.
  2. %
  3. % This software is provided AS-IS with no warranty, either express or
  4. % implied.
  5. %
  6. % This software is distributed under license and may not be copied,
  7. % modified or distributed except as expressly authorized under the terms
  8. % of the license contained in the file LICENSE in this distribution.
  9. %
  10. % For more information about licensing, please refer to
  11. % http://www.ghostscript.com/licensing/. For information on
  12. % commercial licensing, go to http://www.artifex.com/licensing/ or
  13. % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  14. % San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  15. % $Id: stocht.ps,v 1.6 2002/02/21 21:49:28 giles Exp $
  16. % helper file to simplify use of Stochastic Halftone - uses ht_ccsto.ps
  17. % This file sets the /StochasticDefault /Halftone as the current
  18. % and the /Default halftoning, loading the Stochastic halftone
  19. % if required.
  20. % Stochastic halftoning is recommended for inkjet printers, and may
  21. % produce output as pleasing as the more computationally expensive
  22. % "error diffusion" that *some* device drivers provide.
  23. % For printing technologies other than inkjet, Stochastic halftoning
  24. % may not look better than standard screening. In particular, thermal
  25. % transfer and direct thermal tend to be better with standard ordered
  26. % screening methods. Some laser printers may produce "smoother"
  27. % looking gray shades with Stochastic halftoning. Try it, and if
  28. % you like it, use it.
  29. % Note that this /Default halftone can be overridden by PostScript
  30. % operators that set the screening or halftone (such as setscreen).
  31. % To make Stochastic Halftone be "sticky" so that other screening and
  32. % halftone setting in the subsequent PostScript will be ignored, use:
  33. % -c "<< /HalftoneMode 1 >> setuserparams"
  34. % on the command line prior to the file to be processed. For example,
  35. %
  36. % gs stocht.ps -c "<< /HalftoneMode 1 >> setuserparams" -f examples/tiger.eps
  37. % Alternatively, the command to set the /HalftoneMode userparam can be
  38. % concatenated to this file (see below).
  39. % =====================================================================
  40. % Try to get the previously defined resource
  41. { /StochasticDefault /Halftone findresource } stopped
  42. {
  43. pop pop
  44. % Need to load the Stochastic Halftone using the lib file
  45. (ht_ccsto.ps) runlibfile
  46. } if
  47. % If we didn't error out by now, then go ahead and define the /Default
  48. /StochasticDefault /Halftone findresource
  49. /Default exch /Halftone defineresource
  50. sethalftone % Use the halftone
  51. % Uncomment the next line to make the Stocahstic halftoning be "sticky"
  52. % << /HalftoneMode 1 >> setuserparams