Skip to main content

Types of Graphics

Have you ever noticed that when you enlarge any image in your computer, why there is jagged effect? If no, then read whole article . . . .

Types of Graphics

There are two kinds of computer graphics - raster (composed of pixels) and vector (composed of paths). Raster images are more commonly called bitmap images.
Raster Graphics
A bitmap image uses a grid of individual pixels where each pixel can be a different color or shade. Bitmaps are composed of pixels.



Raster graphics are digital images represented by a matrix or grid of pixels commonly called a bitmap. Each pixel or dot displays a unique color and together all of these colored dots create an image. Every pixel in a bitmap is stored as one or more bits in computer memory. Raster graphics with a greater number of colors and pixels will require more bits and take up more memory. Typical file formats for raster graphics include .jpg, .gif, .tiff, and .bmp.

Since raster graphics are represented in a grid structure, the width and height are usually indicated by the number of rows and columns rather than a particular unit of measurement. The size of an image might be described as 640 x 480 meaning that there are 640 pixels in a row and 480 pixels in a column. The resolution or degree of sharpness present in an image is calculated by determining the number of pixels per inch (PPI) or dots per inch (DPI)   A higher resolution raster graphic will have smaller pixels that result in a more detailed image. When raster graphics need to be displayed or printed at larger sizes, it is helpful to use a higher resolution so that the image does not appear grainy.

Black and white raster graphics contain only black and white pixels and each pixel requires just one bit in memory. A colored raster graphic requires additional bits because three values are necessary to represent each of the red, green, and blue components of the pixel. The color depth for an image is represented by the number of bits per pixel and as the color depth increases, more colors are available for display. An image with an 8-bit color depth would have 256 different colors available compared to an image with a 12-bit color depth that would allow for 4,096 colors. Graphics with increased color depth are more adept at displaying shading. Raster graphics are only one of the two common graphic types used to digitally represent 2-D images

Typical bit depths used today are: 1 (two colors, usually black and white), 2 (four colors, usually shades of gray), 4 (16 colors), 8 (256 colors), 16 (65,536 colors), 24 (so-called true color), and 32 (more colors than you can shake a stick at).

The numbers of rows and columns gives you the resolution. If there are c columns and r rows, the image is referred to as a r x c image. If the image is to have a certain physical size, this size combined with the number of pixels give you the number of dots-per-inch (DPI) of the image, which is a measure of its resolution. The higher the DPI, the smaller the dots, and the harder it is to see them as individuals.

The jagged appearance of bitmap images can be partially overcome with the use of "anti-aliasing". Anti-aliasing is the application of subtle transitions in the pixels along the edges of images to minimize the jagged effect (below left). A scalable vector image will always appear smooth (below right):







Bitmap images require higher resolutions and anti-aliasing for a smooth appearance. Vector-based graphics on the other hand are mathematically described and appear smooth at any size or resolution.


Advantages

·         Almost all kinds of pictures, photographs, digital drawings, cliparts can be stored as raster graphics.
·         Vector images can be converted into raster graphics but vice-versa is not possible.

Disadvantages

·         It is very difficult to manipulate the raster images once they developed. To change even small curve every pixel has to be erased and redrawn. There is not much flexibility in manipulating the images.
·         Since every pixel in the image has to be stored as a data, therefore, the file size is high.
·         The other disadvantage with bitmaps is when an image is enlarged, the individual coloured squares become visible and the illusion of a smooth image is lost to the viewer. This 'pixelation' makes the image look coarse.

Vector Graphics
Vector graphics use mathematical relationships between points and the paths connecting them to describe an image. Vector graphics are composed of paths.




A vector graphic is infinitely scalable in size, whereas a raster graphic is resolution dependent and changes in size will detrimentally (adversely) affect the visual quality of the image. Vector graphics are often used for type work and line illustrations while raster graphics are most suitable for photographs and images with continuous tones and shading.
Specialized graphic tools are available for developing vector graphics – Adobe Illustrator, Corel Draw and Macromedia Freehand are some of the prominent packages in the market. All these tools store an artist’s creative strokes as lines, arcs and curves so that all modification are possible at any point of time.

Advantages
·         Since the images are stored as code of line, curves and arcs, therefore, the manipulation in the images can be done easily without any losses. The file size of vector graphics is smaller compared to raster graphics.
·         Since most data, e.g. hard copy maps, is in vector form so no data conversion is required.
Limitations
·         No raster images can be converted into vector images.
·         Not all types of images can be stored as vector graphics. For example, photographs and digital camera pictures, made up of many thousands of colors, cannot be stored as vectors.

Comments

Popular posts from this blog

Characteristics of a Good Programming Language

Till now there are many high level languages which are very popular, and there are others, which could not become so popular in-spite of being very powerful. There might be many reasons for the success of a language, but one obvious reason is the characteristics of the language. Several characteristics believed to be important with respect to making a programming language good are briefly discussed below. Simplicity A good programming language must be simple and easy to learn and use. For example, BASIC is liked by many programmers only because of its simplicity. Thus, a good programming language should provide a programmer with a clear, simple and unified set of concepts which can be easily grasped. It is also easy to develop and implement a compiler or an interpreter for a programming language that is simple. However, the power needed for the language should not be sacrificed for simplicity. The overall simplicity of a programming language strongly affects the readability of the pr...

Angular 4 and Firebase Authentication: Email/Password

In our  previous  article we saw how to create authentication module using Google identity provider. Now we will see how to implement Email and Password authentication using Firebase. We will use Bootstrap form to create intuitive user interface for sign-up and login using Email and Password. Step 1: Create signUp component. ng generate component signUp Step 2: Create custom form in sign-up.component.html file. The result of above code: Step 3: Add two functions for creating the user and login using Email and Password in src/app/providers/AFAuth.ts file. Step 4: Call createUserWithEmailAndPassword function in service from sign-up.component.ts. Step 5: Update routing configuration in app.module.ts  to include signUp component. Step 6: Update Login form to have Bootstrap form. The result of the above code. Step 7: Enable Email/Password component in Firebas...

Angular 4 and Firebase Authentication: Setup

If you have come to this article, it means you are keen to learn new technology and that too Firebase. I love Firebase because it provides all basic but important features of any web application. Take for example, authentication, which is cumbersome and risky if not implemented with utmost care. And when we have the integration of Angular and Firebase, it becomes a lot easier for a developer to build such crucial modules in less time with minimal efforts. In this article we will create a simple Angular application using Firebase. I am going ahead with the understanding that you know the benefits of Firebase and have little knowledge about it. There are plenty of posts out on the web if you are behind. Step 1: Install Angular CLI (if not installed). npm install -g angular-cli Step 2: Create new Angular 4 project. By default now angular CLI will create Angular 4 project so you need not fret. ng new firebase-authentication Step 3: Check whether the ne...