BN.com Gift Guide

Compressed Image File Formats: JPEG, PNG, GIF, XBM, BMP / Edition 1

Other Format (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $16.96
Usually ships in 1-2 business days
(Save 71%)
Other sellers (Other Format)
  • All (12) from $16.96   
  • New (8) from $46.78   
  • Used (4) from $16.96   

Overview

This comprehensive reference on the major graphics file formats and the compression technologies they employ is an indispensable resource for graphics programmers, especially those developing graphical applications for the Web.

Compressed Image File Formats: JPEG, PNG, GIF, XBM, BMP examines the most common graphics file formats in detail and demonstrates how to encode and decode image files for each. In particular, this book offers in-depth coverage of the elaborate JPEG and newer PNG formats, providing clear explanations of complex concepts, experience-based practical techniques, and plentiful code examples. GIF, XBM, and BMP are also covered, with a focus on some of the less familiar and less well-documented features of these common file formats.

Specific topics covered include:

  • Compression technologies that each file format utilizes
  • Color models employed by each file format
  • The advantages and disadvantages of each file format
  • Huffman Coding
  • LZW Compression
  • Deflate/Inflate
  • Progressive JPEG
  • The Discrete Cosine Transform
  • Animated GIF

The accompanying CD-ROM contains the complete source code for all of the image formats covered in the book, as well as working examples and sample images. If you want to learn how to read and write graphic file formats for the Web--including PNG and JPEG files--there is no better resource than this book. System requirements: Windows 95 or Windows NT, Borland C++ Builder 3, or Microsoft Visual C++ 5.0.

0201604434B04062001

Read More Show Less

Editorial Reviews

Booknews
Shows graphics programmers how to write software that can read and write files using various 2-D image formats associated with Web browsers. Topics include compression technologies, color models, Huffman code generation, block ordering, the discrete cosine transform, and animated GIF. The CD-ROM contains source code and examples in C++. Annotation c. Book News, Inc., Portland, OR (booknews.com)
Read More Show Less

Product Details

  • ISBN-13: 9780201604436
  • Publisher: Addison-Wesley
  • Publication date: 8/6/1999
  • Series: ACM Press Series
  • Edition description: BK&CD ROM
  • Edition number: 1
  • Pages: 288
  • Sales rank: 998,548
  • Product dimensions: 7.32 (w) x 9.05 (h) x 0.70 (d)

Meet the Author

John Miano is Chief Engineer of Colosseum Builders, Inc., where he specializes in Web applications for the entertainment and broadcasting industries. He is the author of Borland C++ Builder How-To and has written articles on programming for various computer publications. He holds a bachelor's degree in mathematics from the College of Wooster.

0201604434AB04062001

Read More Show Less

Read an Excerpt

The purpose of this book is to instruct the reader on how to write software that can read and write files using various 2-D image formats. I wanted to write a book that explains the most frequently used file formats with enough depth for the reader to implement them, as opposed to one that covered many different formats at a high level or one that avoided the more difficult image formats. As a result, I chose to cover the image file formats that are associated with Web browsers. Those covered in this book (BMP, XBM, JPEG, GIF, and PNG) represent the vast majority of image files that can be found on the Internet. They employ a wide range of encoding techniques and range in implementation difficulty from simple to very complex.

The inspiration for this book was my own frustration resulting from the lack of information on how to implement encoders and decoders for the more complex file formats. Most of the information available was at too high a level, left major gaps, or was very difficult to decipher. I have tried to create a bridge between the programmer and the standards documents.

One issue I faced at the start of this project was which programming language to use for the examples. The intention was to create a book on graphics file formats rather than one on how to write programs to read and write graphics files in a particular language. Therefore, I debated using a language that is easy to read (e.g., Pascal or Ada) or the one most people are likely to use (C++). In the end I felt that its widespread use made C++ the best choice. To make the examples more understandable for non-C++ programmers, I have carefully avoided certain C++ language constructs (e.g., expressions with side effects and integer/boolean interchangeability) that would make the code difficult for them to understand.

In order to make the encoding and decoding processes as clear as possible, I have used a Pascal-like pseudo-code. C++ is used for complete function implementations and pseudo-code for illustrative fragments. These fragments generally contain no error checking.

Because of their generally large size, it was not possible to include working source code for the formats in the book itself. Instead, the accompanying CD-ROM contains the complete source code for encoders and decoders for almost all of the image formats covered. The reader should use the pseudo-code in the text to learn how processes work and the C++ examples on the CD to see how to implement them.

Generally, the decoders implement more features than the encoders. In the decoders I have implemented all of the features needed to decode files that a reader will have any likelihood of encountering on the Internet. For the sake of clarity, the encoders generally implement a smaller feature subset.

In writing the programming examples I have given clarity precedence over execution efficiency and instant portability. The source examples will compile, without modifications, on Microsoft Windows using both Borland C++Builder V3.0 and Microsoft Visual C++ V5.0. Other compilers generally require some modifications to the code.

The descriptions of the encoders and decoders for the various file formats frequently employ the term "user" to describe the source of certain input parameters to the encoding or decoding process. By this I mean the user of the encoder or decoder, not necessarily the person typing at the keyboard. Since image encoders and decoders are incorporated into other applications, such as image viewers and editors, the user in this case would most likely be another piece of software. However, in many situations the "user" application may get some of these parameters directly from a human.

Just as this is not intended to be a book on C++ programming, it is also not intended to be a book on programming in a specific environment. For that information readers will need a book for their particular system.

A project as large as producing a book requires the involvement of many people. Mike Bailey, Eric Haines, Tom Lane, Shawn Neely, and Glenn Randers-Pehrson reviewed the manuscript and provided many invaluable suggestions. Glenn also arranged for me to get the latest proposed PNG standards for the CD. My fellow aviator, Charlie Baumann, was kind enough to provide several of the photographs. Ralph Miano and Margaret Miano assisted with preparing the manuscript. Jean-Loup Gailley answered all my questions on ZLIB. Albert "The Chipster" Copper compiled examples on systems I did not have access to. Most important, Helen Goldstein at AWL guided the process from start to finish.

John M. Miano
Summit, New Jersey
Read More Show Less

Table of Contents

Preface.

Acknowledgments.

1. Introduction.

The Representation of Images.

Vector and Bitmap Graphics.

Color Models.

True Color versus Palette.

Compression.

Byte and Bit Ordering.

Color Quantization.

A Common Image Format.

Conclusion.

2. Windows BMP.

Data Ordering.

File Structure.

Compression.

Conclusion.

3. XBM.

File Format.

Reading and Writing XBM Files.

Conclusion.

4. Introduction to JPEG.

JPEG Compression Modes.

What Part of JPEG Will Be Covered in This Book?

What are JPEG Files?

SPIFF File Format.

Byte Ordering.

Sampling Frequency.

JPEG Operation.

Interleaved and Noninterleaved Scans.

Conclusion.

5. JPEG File Format.

Markers.

Compressed Data.

Marker Types.

JFIF Format.

Conclusion.

6. JPEG Human Coding.

Usage Frequencies.

Huffman Coding Example.

Huffman Coding Using Code Lengths.

Huffman Coding in JPEG.

Limiting Code Lengths.

Decoding Huffman Codes.

Conclusion.

7. The Discrete Cosine Transform.

DCT in One Dimension.

DCT in Two Dimensions.

Basic Matrix Operations.

Using the 2-D Forward DCT.

Quantization.

Zigzag Ordering.

Conclusion.

8. Decoding Sequential-Mode JPEG Images.

MCU Dimensions.

Decoding Data Units.

Decoding Example.

Processing DCT Coefficients.

Up-Sampling.

Restart Marker Processing.

Overview of JPEG Decoding.

Conclusion.

9. Creating Sequential JPEG Files.

Compression Parameters.

Output File Structure.

Doing the Encoding.

Down-Sampling.

Interleaving.

Data Unit Encoding.

Huffman Table Generation.

Conclusion.

10. Optimizing the DCT.

Factoring the DCT Matrix.

Scaled Integer Arithmetic.

Merging Quantization and the DCT.

Conclusion.

11. Progressive JPEG.

Component Division in Progressive JPEG.

Processing Progressive JPEG Files.

Processing Progressive Scans.

MCUs in Progressive Scans.

Huffman Tables in Progressive Scans.

Data Unit Decoding.

Preparing to Create Progressive JPEG Files.

Encoding Progressive Scans.

Huffman Coding.

Data Unit Encoding.

Conclusion.

12. GIF.

Byte Ordering.

File Structure.

Interlacing.

Compressed Data Format.

Animated GIF.

Legal Problems.

Uncompressed GIF.

Conclusion.

13. PNG.

History.

Byte Ordering.

File Format.

File Organization.

Color Representation in PNG.

Device-Independent Color.

Gamma.

Interlacing.

Critical Chunks.

Noncritical Chunks.

Conclusion.

14. Decompressing PNG Image Data.

Decompressing the Image Data.

Huffman Coding in Deflate.

Compressed Data Format.

Compressed Data Blocks.

Writing the Decompressed Data to the Image.

Conclusion.

15. Creating PNG Files.

Overview.

Deflate Compression Process.

Huffman Table Generation.

Filtering.

Conclusion.

Glossary.

Bibliography.

Index. 0201604434T04062001

Read More Show Less

Preface

The purpose of this book is to instruct the reader on how to write software that can read and write files using various 2-D image formats. I wanted to write a book that explains the most frequently used file formats with enough depth for the reader to implement them, as opposed to one that covered many different formats at a high level or one that avoided the more difficult image formats. As a result, I chose to cover the image file formats that are associated with Web browsers. Those covered in this book (BMP, XBM, JPEG, GIF, and PNG) represent the vast majority of image files that can be found on the Internet. They employ a wide range of encoding techniques and range in implementation difficulty from simple to very complex.

The inspiration for this book was my own frustration resulting from the lack of information on how to implement encoders and decoders for the more complex file formats. Most of the information available was at too high a level, left major gaps, or was very difficult to decipher. I have tried to create a bridge between the programmer and the standards documents.

One issue I faced at the start of this project was which programming language to use for the examples. The intention was to create a book on graphics file formats rather than one on how to write programs to read and write graphics files in a particular language. Therefore, I debated using a language that is easy to read (e.g., Pascal or Ada) or the one most people are likely to use (C++). In the end I felt that its widespread use made C++ the best choice. To make the examples more understandable for non-C++ programmers, I have carefully avoided certain C++ language constructs (e.g., expressions with side effects and integer/boolean interchangeability) that would make the code difficult for them to understand.

In order to make the encoding and decoding processes as clear as possible, I have used a Pascal-like pseudo-code. C++ is used for complete function implementations and pseudo-code for illustrative fragments. These fragments generally contain no error checking.

Because of their generally large size, it was not possible to include working source code for the formats in the book itself. Instead, the accompanying CD-ROM contains the complete source code for encoders and decoders for almost all of the image formats covered. The reader should use the pseudo-code in the text to learn how processes work and the C++ examples on the CD to see how to implement them.

Generally, the decoders implement more features than the encoders. In the decoders I have implemented all of the features needed to decode files that a reader will have any likelihood of encountering on the Internet. For the sake of clarity, the encoders generally implement a smaller feature subset.

In writing the programming examples I have given clarity precedence over execution efficiency and instant portability. The source examples will compile, without modifications, on Microsoft Windows using both Borland C++Builder V3.0 and Microsoft Visual C++ V5.0. Other compilers generally require some modifications to the code.

The descriptions of the encoders and decoders for the various file formats frequently employ the term "user" to describe the source of certain input parameters to the encoding or decoding process. By this I mean the user of the encoder or decoder, not necessarily the person typing at the keyboard. Since image encoders and decoders are incorporated into other applications, such as image viewers and editors, the user in this case would most likely be another piece of software. However, in many situations the "user" application may get some of these parameters directly from a human.

Just as this is not intended to be a book on C++ programming, it is also not intended to be a book on programming in a specific environment. For that information readers will need a book for their particular system.

A project as large as producing a book requires the involvement of many people. Mike Bailey, Eric Haines, Tom Lane, Shawn Neely, and Glenn Randers-Pehrson reviewed the manuscript and provided many invaluable suggestions. Glenn also arranged for me to get the latest proposed PNG standards for the CD. My fellow aviator, Charlie Baumann, was kind enough to provide several of the photographs. Ralph Miano and Margaret Miano assisted with preparing the manuscript. Jean-Loup Gailley answered all my questions on ZLIB. Albert "The Chipster" Copper compiled examples on systems I did not have access to. Most important, Helen Goldstein at AWL guided the process from start to finish.

John M. Miano
Summit, New Jersey
miano@colosseumbuilders.com

0201604434P04062001

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)