MATLAB Answers

How to increase image size while keeping image sharp?

1 view (last 30 days)
Kevin on 11 May 2021
Commented: Kevin on 11 May 2021
Hi everyone,
This is a pretty general question. I took a screenshot of the MATLAB toolstrip (actually part of it).
It looks great except I want it bigger. So I use imresize( ),
B = imresize(A, 4);
but it looks pixelated.
Is there a better way to do this?

Answers (1)

Image Analyst
Image Analyst on 11 May 2021
You need to use the nearest option:
B = imresize(A, 4, 'nearest');
Kevin on 11 May 2021
Here is the mat-file that has the original image.
Actually I have also tried using IrfanView and this is what I did:
load tmp.mat
% Select "Save As" and save the image as PNG file
Open the image in IrfanView and press + a few times to enlarge the image. The result is better than what I get in MATLAB. So there is a solution. What magic in IrfanView?

Sign in to comment.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!