Converting an image of type uint8 to double

In order to change the class of image, you can use the following functions-

>> im = imread('a.jpg');  // To read the image

>> imshow(im);  // To display the image

>> whos im;  // To get info. about image size, type etc., class of im is uint8 here

>> imd = im2double(im);   // Type conversion

>> imshow(imd);  // To display second type image

>> whos imd;   // It will display class type double

Class of an image is changed. It looks exactly as the other one. When we see the type, it is double and pixel value are floating point numbers now. In th convention ‘0’ represents black and ‘1’ represents white. So, this is the another way to represent each pixel of an image i.e in double precision.


Published by


I am the one who discover myself daily through reading, writing, interacting with people and expressing my thoughts to inspire them if I would be able to bring a little change to the society through my work. I write blogs, participate in various social activities and want to be a Professional Speaker. Currently, I am pursuing my post graduation in Computer Applications from Guru Nanak Dev Engineering College, Ludhiana and I’m very much active in many technical & social communities.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s