Skip to content

Instantly share code, notes, and snippets.

@dwayne
Last active December 23, 2015 06:29
Show Gist options
  • Save dwayne/6594231 to your computer and use it in GitHub Desktop.
Save dwayne/6594231 to your computer and use it in GitHub Desktop.
Web Performance Resources

Web Performance

Tools

Tips

  • Do not use PNGs when JPEGs will do. For example, if you have a photographic image then opt for the JPEG format instead. Learned this the hard way.

    Case in point: JPEG (Joint Photographic Experts Group) format can produce a smaller file than PNG for photographic (and photo-like) images, since JPEG uses a lossy encoding method specifically designed for photographic image data, which is typically dominated by soft, low-contrast transitions, and an amount of noise or similar irregular structures. Using PNG instead of a high-quality JPEG for such images would result in a large increase in filesize with negligible gain in quality. In contrast, when storing images that contain text, line art, or graphics – images with sharp transitions and large areas of solid color – the PNG format can compress image data more than JPEG can. Additionally, PNG is lossless, while JPEG produces noticeable visual artifacts around high-contrast areas.

    Image Compression for Web Developers

@dwayne
Copy link
Author

dwayne commented Jun 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment