MATLAB: How to save a image file to a higher resolution that it actually is

image analysisimage processingImage Processing Toolbox

I have a image which when saved is of very low resolution. I wanna save that image as it is, but when i display it again i want it in a higher resolution than it's actually saved as. I'm using the code imwrite to save the image. So can you tell me how do I save the image in a higher resolution or display it in a higher resolution for further processing?

Best Answer

You can use imresize() to increase the pixel count before you write it out. Note that this does not increase the optical resolution - it will look just as blurry, just bigger.
bigMatrix = imresize(originalMatrix, 4); % Blow up by a factor of 4
imwrite(bigMatrix, filename);
You can also blow up images just on display by using the 'InitialMagnification' input parameter to the imshow() function:
imshow(originalMatrix, 'InitialMagnification', 800);