Skip to Main Content
Painting the Web
book

Painting the Web

by Shelley Powers
May 2008
Beginner content levelBeginner
656 pages
17h 41m
English
O'Reilly Media, Inc.
Content preview from Painting the Web

PNG

The PNG format has had a tough time of it because browser companies have been slow to support it. PNG was created as an alternative to GIF during the great days of the GIF patent war, but the GIF patent has expired, making one less reason for vendors to jump to its support.

The PNG format does well with both photos and illustrations, and though it doesn't compress files into as small a size as JPEG, at least it does so losslessly—without degradation of the initial image. The safe archival compression makes PNG a better format for photos that are going to be edited and re-edited.

In addition, the PNG compression technique is more accurate and efficient than that supported for GIFs, so PNGs can compress to a smaller file size than GIFs. File size can be reduced by saving PNG as 8-bit (PNG-8) rather than 32-bit (or PNG-24 in Photoshop, which saves 24 bits for color, 8 bits for alpha transparency), if the tool you are using provides this option. Note, though, that this reduces the color palette and can lead to dithering.

In fact, the only reason to keep either GIF or JPEG is that you can create animations with GIF, and JPEG compresses to a much smaller file than PNG. Oh, and if you want to use transparency and still support IE 6.x, you'll need to use GIF because IE 6.x does not have support for a specific type of transparency called alpha transparency.

PNG and Transparency

There are two forms of transparency: binary and alpha. Binary transparency only supports transparency that is all ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Mastering PHP 7

Mastering PHP 7

Branko Ajzele

Publisher Resources

ISBN: 9780596515096Supplemental ContentErrata Page