Png.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <?xml-stylesheet type="text/xsl" href="../Xsl/doc2html.xsl"?>
  3. <doc>
  4. <title>Portable Network Graphics File Format</title>
  5. <chapter>
  6. <title>Portable Network Graphics File Format</title>
  7. <par>
  8. PNG is extensible file format for the lossless, portable, well-compressed
  9. storage of raster images. PNG provides a patent-free replacement for GIF and can also
  10. replace many common uses of TIFF. Indexed-color, grayscale, and truecolor images
  11. are supported, plus an optional alpha channel. Sample depths range from 1 to 16 bits.
  12. </par>
  13. <par>
  14. Images can also be filtered using different lossless filter for each scanline so that
  15. subsequent compression can produce even smaller images. PNG also supports interlaced
  16. images to allow progressive display.
  17. Imaging can load all possible PNG data formats but cannot save 1, 2, and 4 bit or
  18. interlaced images. It supports all filters when loading or saving images.
  19. Imaging uses <b>ZLib</b> library written by Jean-loup Gailly and Mark Adler
  20. to compress and decompress PNG image data.
  21. It was translated to Pascal by Jacques Nomssi Nzali.
  22. </par>
  23. <table>
  24. <title>Portable Network Graphics File Format Support</title>
  25. <row>
  26. <th>Format</th>
  27. <th>TImageFormat equivalent</th>
  28. <th>Loading</th>
  29. <th>Saving</th>
  30. </row>
  31. <row>
  32. <td>1 bit indexed</td>
  33. <td><icode>ifIndex8</icode></td>
  34. <td>Yes</td><td>No</td>
  35. </row>
  36. <row>
  37. <td>2 bit indexed</td>
  38. <td><icode>ifIndex8</icode></td>
  39. <td>Yes</td><td>No</td>
  40. </row>
  41. <row>
  42. <td>4 bit indexed</td>
  43. <td><icode>ifIndex8</icode></td>
  44. <td>Yes</td><td>No</td>
  45. </row>
  46. <row>
  47. <td>8 bit indexed</td>
  48. <td><icode>ifIndex8</icode></td>
  49. <td>Yes</td><td>Yes</td>
  50. </row>
  51. <row>
  52. <td>24 bit RGB</td>
  53. <td><icode>ifR8G8B8</icode></td>
  54. <td>Yes</td><td>Yes</td>
  55. </row>
  56. <row>
  57. <td>48 bit RGB</td>
  58. <td><icode>ifR16G16B16</icode></td>
  59. <td>Yes</td><td>Yes</td>
  60. </row>
  61. <row>
  62. <td>32 bit ARGB</td>
  63. <td><icode>ifA8R8G8B8</icode></td>
  64. <td>Yes</td><td>Yes</td>
  65. </row>
  66. <row>
  67. <td>64 bit ARGB</td>
  68. <td><icode>ifA16R16G16B16</icode></td>
  69. <td>Yes</td><td>Yes</td>
  70. </row>
  71. <row>
  72. <td>1 bit grayscale</td>
  73. <td><icode>ifGray8</icode></td>
  74. <td>Yes</td><td>No</td>
  75. </row>
  76. <row>
  77. <td>2 bit grayscale</td>
  78. <td><icode>ifGray8</icode></td>
  79. <td>Yes</td><td>No</td>
  80. </row>
  81. <row>
  82. <td>4 bit grayscale</td>
  83. <td><icode>ifGray8</icode></td>
  84. <td>Yes</td><td>No</td>
  85. </row>
  86. <row>
  87. <td>8 bit grayscale</td>
  88. <td><icode>ifGray8</icode></td>
  89. <td>Yes</td><td>Yes</td>
  90. </row>
  91. <row>
  92. <td>16 bit grayscale</td>
  93. <td><icode>ifGray16</icode></td>
  94. <td>Yes</td><td>Yes</td>
  95. </row>
  96. <row>
  97. <td>16 bit grayscale + alpha</td>
  98. <td><icode>ifA8Gray8</icode></td>
  99. <td>Yes</td><td>Yes</td>
  100. </row>
  101. <row>
  102. <td>32 bit grayscale + alpha</td>
  103. <td><icode>ifA16Gray16</icode></td>
  104. <td>Yes</td><td>Yes</td>
  105. </row>
  106. </table>
  107. <par>
  108. When working with PNG files you can find useful some options
  109. which can be set by <ref>SetOption</ref> function and their current values
  110. can be get by <ref>GetOption</ref> function.
  111. Or you can set them by modifying properties of <ref>TPNGFileFormat</ref>
  112. class.
  113. </par>
  114. <table>
  115. <title>Options Related to PNG Files</title>
  116. <row>
  117. <th>OptionId</th>
  118. <th>Allowed Values</th>
  119. <th>Usage</th>
  120. </row>
  121. <row>
  122. <td><ref>ImagingPNGPreFilter</ref></td>
  123. <td><b>0, 1, 2, 3, 4, 5, 6</b></td>
  124. <td>Sets precompression filter used when saving PNG images. Allowed values
  125. are:
  126. <list>
  127. <li>0 - None Filter</li>
  128. <li>1 - Sub Filter</li>
  129. <li>2 - Up Filter</li>
  130. <li>3 - Average Filter</li>
  131. <li>4 - Paeth Filter</li>
  132. <li>5 - Use 0 for indexed/gray images and 4 for RGB/ARGB images</li>
  133. <li>6 - Adaptive filtering - use best filter for each scanline - very slow</li>
  134. </list>
  135. Note that filters 3 and 4 are much slower than filters 1 and 2.
  136. Default value is <b>5</b>. </td>
  137. </row>
  138. <row>
  139. <td><ref>ImagingPNGCompressLevel</ref></td>
  140. <td><b>0 (no compression)</b> to <b>9 (best compression)</b></td>
  141. <td>Sets ZLib compression level used when saving PNG images.
  142. Default value is <b>5</b>. </td>
  143. </row>
  144. </table>
  145. </chapter>
  146. </doc>