home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / NETWORK / netpbm_docs.lzh / NETPBM / DOCS / ppmquant.1 < prev    next >
Text File  |  1996-11-18  |  2KB  |  80 lines

  1. .TH ppmquant 1 "12 January 1991"
  2. .IX ppmquant
  3. .SH NAME
  4. ppmquant - quantize the colors in a portable pixmap down to a specified number
  5. .SH SYNOPSIS
  6. .B ppmquant
  7. .RB [ -floyd | -fs ]
  8. .I ncolors
  9. .RI [ ppmfile ]
  10. .br
  11. .B ppmquant
  12. .RB [ -floyd | -fs ]
  13. .B -map
  14. .I mapfile
  15. .RI [ ppmfile ]
  16. .fi
  17. .SH DESCRIPTION
  18. Reads a portable pixmap as input.
  19. Chooses
  20. .I ncolors
  21. colors to best represent the image, maps the existing colors
  22. to the new ones, and writes a portable pixmap as output.
  23. .IX "colormap reduction"
  24. .PP
  25. The quantization method is Heckbert's "median cut".
  26. .IX "median cut"
  27. .PP
  28. Alternately, you can skip the color-choosing step by
  29. specifying your own set of colors with the
  30. .B -map
  31. flag.  The
  32. .I mapfile
  33. is just a
  34. .I ppm
  35. file; it can be any shape, all that matters is the colors in it.
  36. For instance, to quantize down to the 8-color IBM TTL color set, you
  37. might use:
  38. .nf
  39.     P3
  40.     8 1
  41.     255
  42.       0   0   0
  43.     255   0   0
  44.       0 255   0
  45.       0   0 255
  46.     255 255   0
  47.     255   0 255
  48.       0 255 255
  49.     255 255 255
  50. .fi
  51. If you want to quantize one pixmap to use the colors in another one,
  52. just use the second one as the mapfile.
  53. You don't have to reduce it down to only one pixel of each color,
  54. just use it as is.
  55. .PP
  56. The
  57. .BR -floyd / -fs
  58. flag enables a Floyd-Steinberg error diffusion step.
  59. .IX Floyd-Steinberg
  60. .IX "error diffusion"
  61. Floyd-Steinberg gives vastly better results on images where the unmodified
  62. quantization has banding or other artifacts, especially when going to a
  63. small number of colors such as the above IBM set.
  64. However, it does take substantially more CPU time, so the default is off.
  65. .PP
  66. All flags can be abbreviated to their shortest unique prefix.
  67. .SH REFERENCES
  68. "Color Image Quantization for Frame Buffer Display" by Paul Heckbert,
  69. SIGGRAPH '82 Proceedings, page 297.
  70. .SH "SEE ALSO"
  71. ppmquantall(1), pnmdepth(1), ppmdither(1), ppm(5)
  72. .SH AUTHOR
  73. Copyright (C) 1989, 1991 by Jef Poskanzer.
  74. .\" Permission to use, copy, modify, and distribute this software and its
  75. .\" documentation for any purpose and without fee is hereby granted, provided
  76. .\" that the above copyright notice appear in all copies and that both that
  77. .\" copyright notice and this permission notice appear in supporting
  78. .\" documentation.  This software is provided "as is" without express or
  79. .\" implied warranty.
  80.