Jng.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <?xml-stylesheet type="text/xsl" href="../Xsl/doc2html.xsl"?>
  3. <doc>
  4. <title>JPEG Network Graphics File Format</title>
  5. <chapter>
  6. <title>JPEG Network Graphics File Format</title>
  7. <par>
  8. JNG is a lossy single-image member of the Network Graphics format family.
  9. It encapsulates a JPEG datastream in PNG-style chunks,
  10. along with an optional alpha channel.
  11. While JNG is primarily intended as a subformat of
  12. the MNG (Multiple Network Graphics)
  13. format, standalone JNG files are also possible.
  14. </par>
  15. <par>
  16. Alpha channel in JNG images is stored separately from color/gray data and
  17. can be lossy (as JPEG image) or lossless (as PNG image) compressed.
  18. </par>
  19. <table>
  20. <title>JPEG Network Graphics File Format Support</title>
  21. <row>
  22. <th>Format</th>
  23. <th>TImageFormat equivalent</th>
  24. <th>Loading</th>
  25. <th>Saving</th>
  26. </row>
  27. <row>
  28. <td>24 bit RGB</td>
  29. <td><icode>ifR8G8B8</icode></td>
  30. <td>Yes</td><td>Yes</td>
  31. </row>
  32. <row>
  33. <td>32 bit ARGB</td>
  34. <td><icode>ifA8R8G8B8</icode></td>
  35. <td>Yes</td><td>Yes</td>
  36. </row>
  37. <row>
  38. <td>8 bit grayscale</td>
  39. <td><icode>ifGray8</icode></td>
  40. <td>Yes</td><td>Yes</td>
  41. </row>
  42. <row>
  43. <td>16 bit grayscale + alpha</td>
  44. <td><icode>ifA8Gray8</icode></td>
  45. <td>Yes</td><td>Yes</td>
  46. </row>
  47. </table>
  48. <note>
  49. Lossless JNG alpha channels can have 1, 2, 4, 8, or 16 bit depths
  50. but they are converted to 8 bits so that corresponding Imaging data formats
  51. for joint color/gray + alpha images can be found. Alpha channels are always
  52. saved as 8 bit.
  53. </note>
  54. <par>
  55. When working with JNG files you can find useful some options
  56. which can be set by <ref>SetOption</ref> function and their current values
  57. can be get by <ref>GetOption</ref> function.
  58. Or you can set them by modifying properties of <ref>TJNGFileFormat</ref>
  59. class.
  60. </par>
  61. <table>
  62. <title>Options Related to JNG Files</title>
  63. <row>
  64. <th>OptionId</th>
  65. <th>Allowed Values</th>
  66. <th>Usage</th>
  67. </row>
  68. <row>
  69. <td><ref>ImagingJNGLossyAlpha</ref></td>
  70. <td><b>0 (False)</b> or <b>1 (True)</b></td>
  71. <td> Specifies whether alpha channels of JNG images are lossy compressed.
  72. Default value is <b>0</b>. </td>
  73. </row>
  74. <row>
  75. <td><ref>ImagingJNGAlphaPreFilter</ref></td>
  76. <td><b>0, 1, 2, 3, 4, 5, 6</b></td>
  77. <td>Sets precompression filter used when saving lossless alpha channels.
  78. Allowed values are:
  79. <list>
  80. <li>0 - None Filter</li>
  81. <li>1 - Sub Filter</li>
  82. <li>2 - Up Filter</li>
  83. <li>3 - Average Filter</li>
  84. <li>4 - Paeth Filter</li>
  85. <li>5 - Use 0 for indexed/gray images and 4 for RGB/ARGB images</li>
  86. <li>6 - Adaptive filtering - use best filter for each scanline - very slow</li>
  87. </list>
  88. Note that filters 3 and 4 are much slower than filters 1 and 2.
  89. Default value is <b>5</b>. </td>
  90. </row>
  91. <row>
  92. <td><ref>ImagingJNGAlphaCompressLevel</ref></td>
  93. <td><b>0 (no compression)</b> to <b>9 (best compression)</b></td>
  94. <td>Sets ZLib compression level used when saving lossless alpha channels.
  95. Default value is <b>5</b>. </td>
  96. </row>
  97. <row>
  98. <td><ref>ImagingJNGQuality</ref></td>
  99. <td><b>1</b> to <b>100</b></td>
  100. <td>Defines compression quality used when saving JNG images (and lossy alpha channels).
  101. Higher value means worse compression/better image quality/larger file size.
  102. Default value is <b>90</b>.</td>
  103. </row>
  104. <row>
  105. <td><ref>ImagingJNGProgressive</ref></td>
  106. <td><b>0 (False)</b> or <b>1 (True)</b></td>
  107. <td>Specifies whether JNG images are saved in progressive format.
  108. Progressive JPEG rearranges the stored data into a series of scans of
  109. increasing quality. In situations where a JPEG file is transmitted across a
  110. slow communications link, a decoder can generate a low-quality image very
  111. quickly from the first scan, then gradually improve the displayed quality as
  112. more scans are received. Default value is <b>0 (False)</b>. </td>
  113. </row>
  114. </table>
  115. </chapter>
  116. </doc>