DelphiFAQ Home Search:

Saving images as PNG or GIF?


comments2 comments. Current rating: 5 stars (1 votes). Leave comments and/ or rate it.


Should I save our web site's images as .PNG or as .GIF images?


In the far past, GIF was the standard for non-photographic images while JPEG was for photographic images. The reason is that GIF only allows 256 colors and its compression algorithm is more suited for computer drawings such as buttons, lines etc. The JPEG algorithm is very bad at such graphics e.g. it will have a big quality problem with compressing an image that consists of a thin black line on white ground. GIF would be ideal for that. JPEG on the other hand is ideal for compressing a photo of a sunset with no visible loss. (It does lose many pixels' exact color information but not visible to the human eye.)

After GIF had become a standard, the US based company Unisys remembered that they had a patent on the LZW compression algorithm which is used in GIF. They charged a fee for any application that could read or write GIF images. Note: The Unisys LZW patent expired in the USA on June 20, 2003. It also expired in Canada, France, Italy, Germany, the United Kingdom, and Japan.

For that reason in 1995 an alternative for GIF was created: PNG.

PNG is like GIF lossless, meaning very suitable for computer graphics. It compresses better than GIF though, in almost all cases. PNG also allows more than 256 colors plus it allows variable transparency (alpha channel). PNG allows to store correction factors for brightness (gamma factor) and color hue (GIF does not).

When PNG came out, it was questionable if it was going to be successful simply because GIF images were everywhere and supported by all software (even though the publisher had to pay a fee to Unisys then, even if it was freeware).

However, since ~ 2000, all browsers support PNG, meanwhile even the dreaded Internet Explorer does it error-free.

Therefore I recommend using PNG images for new projects.

Visit to see about the status of PNG support and development.

Content-type: text/html


2009-11-17, 23:55:07
anonymous from India  
pankaj jhmab maker
2009-11-18, 00:10:07
Agent 86 from Salem, United States  
2009-11-17, 23:55:07
anonymous from India

Just in case someone wants to know why the picture was removed.
I removed it because it was of a Baby.
Absolutely unnecessary for it to be posted here.
No pictures of Minors are to be Posted on this site.

Kind regards Agent 86 Maxwell Smart \\'^o^'// <><



NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: