README 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. +----------------------------------------------------------------------+
  2. | tiff2png - converts a Tagged Image File Format (TIFF) file into |
  3. | a Portable Network Graphics (PNG) file |
  4. | |
  5. | Copyright 1996,2000 Willem van Schaik, Singapore (willem@schaik.com) |
  6. | Copyright 1999-2002 Greg Roelofs (newt@pobox.com) |
  7. | |
  8. +----------------------------------------------------------------------+
  9. This is the first attempt for a tiff2png program. Reason to develop
  10. it was the lack of conversion possibilities for TIFF files containing
  11. alpha channels.
  12. Especially NeXT users create lots of TIFF files that have the rather
  13. exceptional 2-bit gray and 4-bit color formats, where both can have
  14. an alpha channel besides the graphics info. Because PBMplus is not
  15. supporting alpha, that path "tifftopnm <file> | pnmtopng > <file>"
  16. makes that the alpha and transparency gets lost.
  17. I have chosen to use PNG formats as similar as possible to the
  18. format of the original TIFF file. Thus, paletted TIFF files will be
  19. converted into PNG files with color-type 3 (= paletted). Only for
  20. some cased the bit-depth had to be altered to accommodate both
  21. standards.
  22. At this moment the program supports grayscale images, full-color RGB
  23. images, and colormapped (palette) images. This is all in 1 to 16 bits
  24. per sample (i.e., up to 64-bit RGBA). The compression is as good as
  25. or better than libtiff is, which is pretty OK. I also implemented
  26. support for both single-image-planes as well as separated-color-planes.
  27. Support for so-called tiled images I have left out, for the time being.
  28. [partial support for tiled images added as of version 0.9]
  29. Major headaches were the PhotometricInterpretation parameters
  30. "min-is-white" and "min-is-black". I couldn't yet figure it out for
  31. 100%, but I suspect incompatibilities between older (netpbm) version
  32. 2.4 of libtiff and the later v3.x. The "-invert" option is available
  33. in case there are still problems with some images.
  34. The major decoding and coding work is done by the libtiff, libpng, and
  35. zlib libraries; newer versions of libtiff can optionally use libjpeg,
  36. as well. So you need to get those as well. The latest versions of
  37. libtiff can be found here:
  38. http://www.libtiff.org/
  39. Older versions may still exist here:
  40. ftp://ftp.sgi.com/graphics/tiff/tiff-v3.4-tar.gz
  41. ftp://ftp.x.org/R5contrib/netpbm-1mar1994.tar.gz [contains 2.4]
  42. libpng and zlib may be found at these sites:
  43. http://www.libpng.org/pub/png/libpng.html
  44. http://www.zlib.org/
  45. or here:
  46. ftp://swrinde.nde.swri.edu/pub/png/src/ (libpng* or lpng*, and zlib*)
  47. libjpeg is available here:
  48. http://www.ijg.org/
  49. ftp://ftp.uu.net/graphics/jpeg/
  50. To build, first make zlib, libpng, libjpeg, and libtiff according to
  51. their build instructions. Then edit the tiff2png makefile so that the
  52. locations of the libraries are correct, and type "make". A separate
  53. archive, tiff2png-images.zip, contains some test files; the included
  54. script Alpha.sh will convert all of the TIFFs, overwriting the PNGs at
  55. the same time. :-) If you have a web browser with adequate alpha support
  56. (see http://www.libpng.org/pub/png/pngapbr.html for info and links),
  57. you can test the results by loading Alpha.html in your browser and see
  58. what happens when you change the background color of the page.
  59. I also tested this utility against the test pictures at ftp.sgi.com.
  60. With the exception of the tiled images (not retested since support for
  61. tiled images was added in tiff2png 0.9), the results were good. But
  62. there can and will still be many TIFF files that don't convert correctly.
  63. Please send Greg a copy if you come across such a beast--as long as
  64. it's not multi-megabytes in size!
  65. For the time being I concentrated on straightforward support of as
  66. many formats as possible. Future plans are to create PNG chunks for
  67. all those informational fields that TIFF also contains, like Name,
  68. Date, Position, Resolution, etc. A somewhat bolder plan is to
  69. convert the ColorResponseCurves field into PNG gamma/chromaticity
  70. or iCCP chunks. We'll see. At the moment there is a command-line
  71. parameter to add a gamma chunk to your PNG file; if you know what
  72. color space the image pixels are in (e.g., sRGB -> gamma 1/2.2 =
  73. 0.45455), you can (and should!) add this information to the PNG
  74. file(s).
  75. The tiff2png web page is here:
  76. http://www.libpng.org/pub/png/apps/tiff2png.html
  77. Willem's home page is here:
  78. http://www.schaik.com/
  79. Please send bug reports to Greg Roelofs (newt@pobox.com) and thanks
  80. to Willem (willem@schaik.com).
  81. Greg Roelofs
  82. newt@pobox.com