Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7960601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:48:04+00:00 2026-06-04T04:48:04+00:00

The full question from our sample exam paper: Explain by highlighting the relevant parts

  • 0

The full question from our sample exam paper:

Explain by highlighting the relevant parts of the algorithm, why the GIF format is not the most compact format for representing images with natural content.

I understand that using GIFs wouldn’t be great for natural images because it’s limited to 256 colours, but why wouldn’t it provide a sufficiently compact file? If anything, you’d think that less colours would imply smaller file-sizes.

In our notes we’re told that the LZW compression used is better than Huffman for a few reasons (incl. the fact it only does one pass). Would Huffman encoding/compression result in a smaller file?

According to Wikipedia, the PNG format provides better compression than GIF. LZW is most likely the culprit then, but why? Which “parts of the algorithm” support the argument that it “is not the most compact format for representing images”, particularly for natural images?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:48:06+00:00Added an answer on June 4, 2026 at 4:48 am

    I’m not precisely sure on the details of LZW coding, but I believe it compresses data by building a dictionary of common bit sequences (which must be identical each time they appear). This means that line-drawings and so forth compress very well, because they contain many areas of “solid” colour (i.e. the same pixel colours repeated identically, many times in a row.) If you have an area of 100 white pixels, you can compress that by saying it’s ‘100 of the same white pixel in a row’.

    “Natural images”, such as those produced by digital cameras, don’t contain areas of solid colour. A photo of a blue wall will actually contain many different shades of blue – camera noise, at the very least, will make every pixel slightly different from its neighbours. LZW will not be able to find many repeated sequences, so it won’t be able to compress the data much.


    JPEG achieves smaller file sizes than GIF because it’s not afraid to lose a bit of information from the picture – it’s lossy. The trick is that JPG is designed to only lose information that humans are bad at seeing anyway. (See note 1.) We’re good at seeing artifacts in “smooth” areas of pictures, but not good at seeing artifacts near sharp transitions in the image.

    It’s also an entirely different breed of compression algorithm, based on encoding the image as a 2-D frequency domain representation (digital signals processing type stuff) rather than trying to find repeating subsequences of bits.


    Note 1: JPEG is a “perceptual” compression method. It plays to human visual strengths and weaknesses – small errors in “smooth” regions of colour are very easy to see, but small errors in “busy” areas of the image are quite easy to miss amongst the details.

    MP3 audio works on the same principle. It throws away information that we can’t hear; for example, if there’s a loud sound followed by a quiet sound, we generally can’t hear the quiet sound – our ears have been overwhelmed by the loud sound, and won’t pick up the quiet sound that comes after it. The MP3 encoding throws away the quiet sound and concentrates on getting the loud sounds right.


    Note 2:

    I just realised I haven’t actually addressed PNG.

    PNG achieves better compression than GIF because it applies a pre-filtering step before the lossless compression (i.e. DEFLATE, roughly equivalent to LZW.) See Wikipedia’s explanation of PNG filtering.

    The idea is that neighbouring pixels may be slightly different from each other (due to noise), but they will be roughly the same value.

    Say we had the data:

    132 133 134 135 136 137 138
    

    LZW looks at this and says “these values are all different; I can’t compress that.”

    PNG looks at this in terms of the differences between values:

    132 +1 +1 +1 +1 +1 +1 +1
    

    That is, the first data element is 132, and the following elements are obtained by adding 1. This representation compresses quite well with LZW.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not a full-time jQuery nor Javascript dev so sorry if dumb question. I think
Summary Below is the full question (a bit complicated in its full form) here's
This is based on my full question . I decided to take it in
Here's some code (full program follows later in the question): template <typename T> T
Sorry for this long post. The question is however small but requires full detail.
Our software is not ever officially installed on Windows, and currently has an update
While I have a successful method of getting users from our mobile site to
Question is regards to handling Request IDs from App Request. Is there any way
Full disclaimer: I'm a CS student, and this question is related to a recently
I am still trying to create a full DOM document from a string. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.