home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.compression:4286 comp.dcom.fax:2357 comp.graphics:13303
- Newsgroups: comp.compression,comp.dcom.fax,comp.graphics
- Path: sparky!uunet!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!torn!news.ccs.queensu.ca!hausner
- From: hausner@qucis.queensu.ca (Alejo Hausner)
- Subject: Re: I want specs for CCITT group 4 Fax
- Message-ID: <C05zrt.Gz3@knot.ccs.queensu.ca>
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: M.Sc, C.S, Queen's, Kingston, Canada.
- References: <freek.725838286@groucho.phil.ruu.nl>
- Date: Fri, 1 Jan 1993 07:35:53 GMT
- Lines: 67
-
- In article <freek.725838286@groucho.phil.ruu.nl> freek@phil.ruu.nl (Freek Wiedijk) writes:
- >Subject says it all. It is question 18 in the FAQ of
- >comp.compression.
- >
-
- As I understand it, CCITT Group 4 is a method for compressing
- pixelized black-and-white images. I'll give the basic ideas, and
- append some references.
-
- Most b/w images have have groups of adjacent pixels which are the
- same colour. Thus scanning the image row by row from top to
- bottom produces sequences of identical pixels, or "runs". There
- will be a run of black pixels, then a whole run of white one,
- then black, etc. Considerable compression is achieved by
- run-length encoding. This means that instead of sending every
- pixel, we send the length of each run, and the colour of the
- pixels in the run. Thus
-
- wwwbbwwwbbbbbwww
-
- becomes
-
- 3w2b3w5b3w
-
- Further compression is possible by noting that runs alternate, so
- that the colour of the pixels can be inferred from the context.
- As long as we agree that the first run will be white, we just
- need to send the numbers
-
- 3,2,3,5,3
-
- to convey the same information. If the first run is black, we
- stick a 0-length white run to keep things clear.
-
- A final step involves using Huffman codes to further compress the
- number of bits sent. For example, printed text will have a lot
- of parts where the pixel rows cross the vertical bits of letters.
- In those places, there will be runs of 2 or 3 black pixels. By
- using short codes to send those run lengths and longer codes for
- others, Huffman coding saves transmission (or storage) time.
-
- Hope that helps.
-
-
- The reference for a paper on the fax standard is:
-
- R. Hunter and A.H. Robinson, "International Digital Facsimile Coding
- Standards", in "Proceedings of the IEEE", 68:7, pp 854-867 (1980).
-
- Ed Kershenbaum tells me that there is software on the net
- implementing the standard:
-
- > Take a look at Sam Leffler's public domain tiff library
- > (~/pub/graphics/tiff/v3.0.tar.Z on sgi.com).
- >
- > Tiff handles Group 4 compression. Included with the library are several
- > utilities to manipulate tiff images.
- >
- > The TIFF specification documents include an appendix on the CCITT
- > compression algorithms. You can download it from the same place
- > (TIFF6.ps.Z).
- >
- > kershenb@gsc.gsi.com
-
- Alejo Hausner (hausner@qucis.queensu.ca)
-
-
-