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

  • Home
  • SEARCH
  • 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 6684715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:58:20+00:00 2026-05-26T04:58:20+00:00

When should certain image file types be used when building websites or interfaces, etc?

  • 0

When should certain image file types be used when building websites or interfaces, etc?

What are their points of strength and weakness?

I know that PNG & GIF are lossless, while JPEG is lossy.
But what is the main difference between PNG & GIF?
Why should I prefer one over the other?
What is SVG and when should I use it?

If you don’t care about each and every pixel, should you always use JPEG since it’s the “lightest” one?

  • 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-05-26T04:58:20+00:00Added an answer on May 26, 2026 at 4:58 am

    You should be aware of a few key factors…

    First, there are two types of compression: Lossless and Lossy.

    • Lossless means that the image is made smaller, but at no detriment to the quality.
    • Lossy means the image is made (even) smaller, but at a detriment to the quality. If you saved an image in a Lossy format over and over, the image quality would get progressively worse and worse.

    There are also different colour depths (palettes): Indexed color and Direct color.

    • Indexed means that the image can only store a limited number of colours (usually 256), controlled by the author, in something called a Color Map
    • Direct means that you can store many thousands of colours that have not been directly chosen by the author

    BMP – Lossless / Indexed and Direct

    This is an old format. It is Lossless (no image data is lost on save) but there’s also little to no compression at all, meaning saving as BMP results in VERY large file sizes. It can have palettes of both Indexed and Direct, but that’s a small consolation. The file sizes are so unnecessarily large that nobody ever really uses this format.

    Good for: Nothing really. There isn’t anything BMP excels at, or isn’t done better by other formats.

    BMP vs GIF


    GIF – Lossless / Indexed only

    GIF uses lossless compression, meaning that you can save the image over and over and never lose any data. The file sizes are much smaller than BMP, because good compression is actually used, but it can only store an Indexed palette. This means that for most use cases, there can only be a maximum of 256 different colours in the file. That sounds like quite a small amount, and it is.

    GIF images can also be animated and have transparency.

    Good for: Logos, line drawings, and other simple images that need to be small. Only really used for websites.

    GIF vs JPEG


    JPEG – Lossy / Direct

    JPEGs images were designed to make detailed photographic images as small as possible by removing information that the human eye won’t notice. As a result it’s a Lossy format, and saving the same file over and over will result in more data being lost over time. It has a palette of thousands of colours and so is great for photographs, but the lossy compression means it’s bad for logos and line drawings: Not only will they look fuzzy, but such images will also have a larger file-size compared to GIFs!

    Good for: Photographs. Also, gradients.

    JPEG vs GIF


    PNG-8 – Lossless / Indexed

    PNG is a newer format, and PNG-8 (the indexed version of PNG) is really a good replacement for GIFs. Sadly, however, it has a few drawbacks: Firstly it cannot support animation like GIF can (well it can, but only Firefox seems to support it, unlike GIF animation which is supported by every browser). Secondly it has some support issues with older browsers like IE6. Thirdly, important software like Photoshop have very poor implementation of the format. (Damn you, Adobe!) PNG-8 can only store 256 colours, like GIFs.

    Good for: The main thing that PNG-8 does better than GIFs is having support for Alpha Transparency.

    PNG-8 vs GIF


    PNG-24 – Lossless / Direct

    PNG-24 is a great format that combines Lossless encoding with Direct color (thousands of colours, just like JPEG). It’s very much like BMP in that regard, except that PNG actually compresses images, so it results in much smaller files. Unfortunately PNG-24 files will still be bigger than JPEGs (for photos), and GIFs/PNG-8s (for logos and graphics), so you still need to consider if you really want to use one.

    Even though PNG-24s allow thousands of colours while having compression, they are not intended to replace JPEG images. A photograph saved as a PNG-24 will likely be at least 5 times larger than a equivalent JPEG image, with very little improvement in visible quality. (Of course, this may be a desirable outcome if you’re not concerned about filesize, and want to get the best quality image you can.)

    Just like PNG-8, PNG-24 supports alpha-transparency, too.


    SVG – Lossless / Vector

    A filetype that is currently growing in popularity is SVG, which is different than all the above in that it’s a vector file format (the above are all raster). This means that it’s actually comprised of lines and curves instead of pixels. When you zoom in on a vector image, you still see a curve or a line. When you zoom in on a raster image, you will see pixels.

    For example:

    PNG vs SVG

    SVG vs PNG

    This means SVG is perfect for logos and icons you wish to retain sharpness on Retina screens or at different sizes. It also means a small SVG logo can be used at a much larger (bigger) size without degradation in image quality — something that would require a separate larger (in terms of filesize) file with raster formats.

    SVG file sizes are often tiny, even if they’re visually very large, which is great. It’s worth bearing in mind, however, that it does depend on the complexity of the shapes used. SVGs require more computing power than raster images because mathematical calculations are involved in drawing the curves and lines. If your logo is especially complicated it could slow down a user’s computer, and even have a very large file size. It’s important that you simplify your vector shapes as much as possible.

    Additionally, SVG files are written in XML, and so can be opened and edited in a text editor(!). This means its values can be manipulated on the fly. For example, you could use JavaScript to change the colour of an SVG icon on a website, much like you would some text (ie. no need for a second image), or even animate them.

    In all, they are best for simple flat shapes like logos or graphs.

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

Sidebar

Related Questions

I want to create gif/png image file using java programatically. This gif/png image should
When a user clicks a certain link which contains an image that should be
The following code should show a certain track in iTunes: NSString* iTunesPath = [[NSWorkspace
I have a when in JBehave which under certain circumstances should throw an exception.
I've got a few methods that should call System.exit() on certain inputs. Unfortunately, testing
We have 18 databases that should have identical schemas, but don't. In certain scenarios,
I'm having following problem. I should convert a control to a certain type, this
Say I have an PNG image where I want to change certain pixels to,
I want all .jpg links to have a certain background image. so a link
I have a grayscale image from a photograph. I've determined that certain parts of

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.