GIF and JPEG are two of the most popular formats for graphics files on the Internet. It is advisable to use JPEG for photos, GIF for animations, and PNG for other images needed for online use.
No, but parts of the technology, including its compression methods, have been the subject of multiple patent lawsuits.
Uniform Type Identifier
com.compuserve.gif
public.jpeg
Magic Number
GIF87a/GIF89a
ff d8
Color depth
Only 256 colors supported
8-bit (grayscale), 12-bit, 24-bit
Applications
JPEG files are best for photographs. GIF files are appropriate for images that are animations. A limitation of GIF files is that they only support 256 colors.
File size
JPEG is a "lossy" format and you can control the file size by tweaking the Quality parameter in most image editing software. This parameter controls the aggressiveness of lossy compression used in the file. Generally, files saved at 85-90% quality using tools like ImageOptim result in significantly reduced file sizes, at the cost of minor color and detail loss that is usually indistinguishable to the naked eye.
GIF files offer pretty good compression (better than JPEG) but they only support 256 colors. Experts recommend using PNG files instead of GIF for all non-animation applications.
Nick Jasuja
has over 15 years of technology industry experience, including at Amazon in Seattle. He is an expert at building websites, developing software programs in PHP and JavaScript, maintaining MySQL and PostgreSQL databases, and running Linux servers for serving high-traffic websites. He has a bachelor's degree in Computer Science & Engineering.
Comments: GIF vs JPEG