Image file formats
Categories: data representation imaging
There are many different image file formats. Here are some of the most common bitmap and vector formats.
Bitmap formats
PNG format
PNG (Portable Network Graphics) was introduced in 1996, mainly aimed at providing a suitable modern image format for the internet. It supports full colour images, and monochrome. It also supports transparency, including semi-transparency.
PNG uses Zip compression, which provides reasonable lossless compression for most images. It does not perform quite as well as JPEG for photographs.
JPEG format
JPEG (named after the group that created it, Joint Photographic Experts Group) was introduced in 1992. With the introduction of digital cameras, a format was required which compressed digital photographs very efficiently.
JPEG uses lossy compression. The image you get back isn't exactly the same as the original, it has some blurring and noise, but it is generally difficult to spot if the image is a photograph of a natural scene. It has quality settings, which can make the compressed file smaller, at the expense of image quality.
JPEG distorts hard edges quite badly, so it isn't suitable for images of diagrams or text. It is generally better to use PNG for those types of image.
BMP format
Windows BMP (Bitmap) format is a very simple format for storing RGB or Monochrome images. It allows various bit depths up to 24 bit RGB, and allows transparency. It uses run length encoding which is simple and works well with small icon or sprite images, but does not work well at all with large photographs.
BMP was the default file format for Microsoft Windows images, but in many cases PNG is now used instead.
GIF format
GIF (Graphics Interchange Format) was the first image format to be widely supported by the World Wide Web. The Web needed an image format which was independent and offered good compression. GIF seemed to be the best solution, so most browsers added support for it. GIF also allowed for transparency and simple animation.
However, GIF only supports 256 colours, so it could not display good quality photographic images. It has now largely been replaced by JPEG and PNG.
Vector formats
SVG format
SVG (Standard Vector Graphics) is a vector format which uses XML (a text format similar to HTML) to store images.
The format can be used to define lines, curves, shapes and text (using standard fonts). All shapes can be filled and outlined using solid colour, gradients (varying colours), images or patterns. SVG also supports effects such as blur and shadow.
SVG format is supported in modern web browsers, so you can include vector graphics just as easily as images. Inkscape (open source vector graphics editing software) supports SVG as its native format.
PDF format
PDF (Portable Document Format) is a format developed by Adobe Inc to allow documents to be shared across different computer systems.
Many different types of documents can be converted to PDF. For example, a Microsoft word document can be saved as a PDF, which means it can be viewed or printed on any system which has a PDF viewer (even if it doesn't have a copy of Word installed). However, PDF documents are mainly intended to be read-only, you cannot usually edit them (except for making small changes which don't affect the overall layout of the document).
PDF is a vector format, so it can be rescaled perfectly for different devices and different printers. It is a lot more than an image format, it is a document format supporting multiple pages. PDF has advanced features such as colour correction which are used in professional printing.
See also
- Binary
- Bits and bytes
- Units of storage
- Powers of two
- Representing numbers
- Binary numbers
- Hexadecimal numbers
- Adding binary numbers
- Negative binary numbers
- Bitwise logical operations
- Binary shift
- Character representation
- ASCII
- Extended ASCII
- Unicode
- Digital images
- Bitmap images
- Computer colour
- Colour depth
- Vector images
- Computer sound
- Recording sound
- Playing sound
- Sound file formats
Sign up to the Creative Coding Newletter
Join my newsletter to receive occasional emails when new content is added, using the form below:
Popular tags
555 timer abstract data type abstraction addition algorithm and gate array ascii ascii85 base32 base64 battery binary binary encoding binary search bit block cipher block padding byte canvas colour coming soon computer music condition cryptographic attacks cryptography decomposition decryption deduplication dictionary attack encryption file server flash memory hard drive hashing hexadecimal hmac html image insertion sort ip address key derivation lamp linear search list mac mac address mesh network message authentication code music nand gate network storage none nor gate not gate op-amp or gate pixel private key python quantisation queue raid ram relational operator resources rgb rom search sort sound synthesis ssd star network supercollider svg switch symmetric encryption truth table turtle graphics yenc