NADBYTE

Types of Images Image Arithmetic

Image Arithmetic

Types of Images

There are many type of images , and we will look in detail about different types of images , and the color distribution in them.

The binary image

Format

Binary images have a format of PBM Portable bit map

2 , 3 , 4 ,5 ,6 bit color format

8 bit color format

Format

Behind gray scale image:

16 bit color format

Another distribution of 16 bit format is like this:

Indexed Images

>> imread(X, Map)

How to add a constant to an Image

I = imread('rice.png');
J = imadd(I,50); 
subplot(1,2,1); 
imshow(I);
title('Original');
subplot(1,2,2); 
imshow(J);
title('Constant added Image');

How to Subtract a constant to an Image

I = imread('rice.png');
J = imsubtract(I,50); 
subplot(1,2,1); 
imshow(I);
title('Original');
subplot(1,2,2); 
imshow(J); 
title('Constant subtracted Image');

How to Divide a constant to an Image

I = imread('rice.png');
J = imdivide(I,2); 
subplot(1,2,1); 
imshow(I); 
title('Original');
subplot(1,2,2); 
imshow(J); 
title('Constant Divided Image');

Scale an Image by a constant factor

I = imread('rice.png');

J = immultiply(I,0.5); 
subplot(1,2,1); 
imshow(I); 
title('Original');

subplot(1,2,2); 
imshow(J); 
title(‘Scaled Image by constant');


Exit mobile version