About libTIFF

CCITT Group 4 compression, also referred to as G4 or Modified Modified READ (MMR), is a lossless method of image compression used in Group 4 fax machines defined in the ITU-T T.6 fax standard. It is only used for bitonal (black and white) images. Group 4 compression is based on the Group 3 two-dimensional compression scheme (G3-2D), also known as Modified READ, which is in turn based on the Group 3 one-dimensional compression scheme (G3), also known as Modified Huffman coding. Group 4 compression is available in many proprietary image file formats as well as standardized formats such as TIFF, CALS, and the PDF document format.

G4 offers a small improvement over G3-2D by removing the end of line (EOL) codes. G3 and G4 compression both treat an image as a series of horizontal black strips on a white page. Better compression is achieved when there are fewer unique black dots/lines on the page. Both G3-2D and G4 add a two dimensional feature to achieve greater compression by taking advantage of vertical symmetry. A worst-case image would be an alternating pattern of single-pixel black and white dots offset by one pixel on even/odd lines. G4 compression would actually increase the file size on this type of image. G4 typically achieves a 20:1 compression ratio.[citation needed] For an 8.5"x11" page scanned at 200 DPI, this equates to a reduction from 456.54 kB to 22.82 kB (95% compression ratio).

//*********************** About JBIG2

JBIG2 is an image compression standard for bi-level images, developed by the Joint Bi-level Image Experts Group. It is suitable for both lossless and lossy compression. According to a press release[1] from the Group, in its lossless mode JBIG2 typically generates files one third to one fifth the size of Fax Group 4 and one half to one quarter the size of JBIG, the previous bi-level compression standard released by the Group. JBIG2 has been published in 2000 as the international standard ITU T.88,[2] and in 2001 as ISO/IEC 14492.[3]

libTiff.Net:

http://bitmiracle.com/libtiff/

https://bitmiracle.github.io/libtiff.net/?topic=html/c3b8a067-673b-42d0-9d38-991c8964d125.htm

https://github.com/BitMiracle/libtiff.net

http://www.remotesensing.org/libtiff/  //C lib

* libTiff do not implement JBIG/JIBG2, it just a placeholder in the compression.

//*********************************************

TIFF is the format of choice for archiving important images. TIFF is THE leading commercial and professional image standard. TIFF is the most universal and most widely supported format across all platforms, Mac, Windows, Unix. Data up to 48 bits is supported.

TIFF supports most color spaces, RGB, CMYK, YCbCr, etc. TIFF is a flexible format with many options. The data contains tags to declare what type of data follows. New types are easy to invent, and this versatility can cause incompatibly, but about any program anywhere will handle the standard TIFF types that we might encounter. TIFF can store data with bytes in either PC or Mac order (Intel or Motorola CPU chips differ in this way). This choice improves efficiency (speed), but all major programs today can read TIFF either way, and TIFF files can be exchanged without problem.

Several compression formats are used with TIF. TIF with G3 compression is the universal standard for fax and multi-page line art documents (line art).

For photographic images, TIFF image files can use LZW lossless compression. Lossless means there is no quality loss due to compression. Lossless guarantees that you can always read back exactly what you thought you saved, bit-for-bit identical, without data corruption. This is a critical factor for archiving master copies of important images. Most image compression formats are lossless, with JPG and Kodak PhotoCD PCD files being the main exceptions.

Compression works by recognizing repeated identical strings in the data, and replacing the many instances with one instance, in a way that allows unambiguous decoding without loss. This is fairly intensive work, and any compression method makes files slower to save or open.

LZW is most effective when compressing solid indexed colors (graphics), and is less effective for 24 bit continuous photo images. Featureless areas compress better than detailed areas. LZW is more effective for grayscale images than color. LZW is often counter-productive for 48 bit images, the 16 bit TIF file using LZW will probably be considerably larger than one with no compression. (VueScan 48 bit TIF LZW is an exception to this, using an efficient data type that not all others use ).

LZW is Lempel-Ziv-Welch, named for Israeli researchers Abraham Lempel and Jacob Zif who published IEEE papers in 1977 and 1978 (now called LZ77 and LZ78) which were the basis for most later work in compression. Terry Welch built on this, and published and patented a compression technique that is called LZW now. This is the 1984 Unisys patent (now Sperry) involved in TIF LZW and GIF (and V.42bis for modems). There was much controversy about a royalty for LZW for GIF, but royalty was always paid for LZW for TIF files and for v.42bis modems. International patents recently expired in mid-2004.

It is not necessary to say much about TIF. It works, it's important, it's great, it's practical, it's the standard universal format for high quality images, it simply does the best job the best way. Give TIF very major consideration, both for photos and documents, especially for archiving anything where quality is important.

But TIF files for photo images are generally pretty large. Uncompressed TIFF files are about the same size in bytes as the image size in memory. Regardless of the novice view, this size is a plus, not a disadvantage. Large means lots of detail, and it's a good thing. 24 bit RGB image data is 3 bytes per pixel. That is simply how large the image data is, and TIF LZW stores it with recoverable full quality in a lossless format (and again, that's a good thing). Large disks are inexpensive today.

There are situations for less serious purposes when the full quality may not always be important or necessary. JPEG files are much smaller, and are suitable for non-archival purposes, like photos for read-only email and web page use, when small file size may be more important than maximum quality. JPG has its important uses, but be aware of the large price in quality that you must pay for the small size of JPG, it is not without cost.


猜你喜欢

转载自shappy1978.iteye.com/blog/2256459