Friday, June 17, 2022

All about Graphics and Image File Formats

All about Graphics and Image File Formats


Graphics are broadly classified in to Raster or Vector Graphics. Raster Graphics are in the form of Bitmap Graphics wherein each pixel would have a different color and eventually a collection of pixels would compose into any graphic form that it would shape into.

Raster or Bitmap graphics are used in Photographs or color intensive applications.


Vector Graphics are essentially geometric shapes in an outline with color filled in to it.

On expanding a vector graphic the geometric shape is reconstructed and the fill color or Vignette/Gradient is refilled in to it. Here the computer only stores the geometric shape related info and the color info and hence the file sizes of these applications are lighter also there is no pixel tearing on expanding any image constructed using Vector Graphics.

Vector Graphics are used in Applications like CorelDraw or Adobe Illustrator and Line art Graphics are created is 3D rendering software like AutoCAD and other Civil Engineering and Architecture related software.


For Raster Graphics most common Web File formats like GIF, PNG, and JPEG are used.

GIF - Graphic Interchange Format is a proprietary file format which stores color in the form of Indexed Colors. Index color is a 8 Bit File format containing the ability to store up to 256 colors with the addition of one of the 256 colors allowed to be completely transparent.


PNG - Portable Network Graphics was an unpatented and improved file format developed to replace GIF file format. PNGs support 8 Bit as well as 24 Bit File formats. The 8-Bit format supports up to 256 colors and one transparent color allowed just as the GIF file format.

PNG supports palette-based images with palettes of 24-bit RGB or 32-bit RGBA colors

Here PNG supports Alpha Transparency with 256 shades of grey giving you a gradient semitransparent image.


Unofficially, the initials PNG stood for the recursive acronym "PNG's not GIF"

- Above line is an excerpt from Wikipedia's PNG Article


Last but not the least JPEG - which is the Joint Photographic Engineering Group or JPG in short is a file format supporting 24 Bit Images primarily designed for Photographic images. It stores and recreates color information in an extremely efficient manner.


The human eye perceives color based on its adjacent color. Hence JPEG Devised a compression algorithm of rendering color in photographic images in such a manner that during compression it actually deletes alternate lines of color and renders/recreates this line of color on its own and even when images are stretched  to a certain extent, it manages to reduce the image file size and still recreates the same image without any artifacts and which is pretty close to the original image.


In the next article I will explain more about - "Display Colors, Color Modes and Color Spaces"