How to increase image size while keeping image sharp?

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?

2 件のコメント

Jonas
Jonas 2021 年 5 月 11 日
did you try the imsharpen() function?
Kevin
Kevin 2021 年 5 月 11 日
Just try it out. Does not help (it does not make it worst).

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2021 年 5 月 11 日

0 投票

You need to use the nearest option:
B = imresize(A, 4, 'nearest');

5 件のコメント

Kevin
Kevin 2021 年 5 月 11 日
I have tried this,
B = imresize(A, 4, 'nearest');
B = imsharpen(B);
Does not help.
Image Analyst
Image Analyst 2021 年 5 月 11 日
I don't think you should use sharpen after it. That might introduce noise. The nearest option should give edges just as sharp as in the original, the only thing is it might give you jaggies that didn't exist in the original (because you magnified it so there are now more pixels).
Kevin
Kevin 2021 年 5 月 11 日
I guess there is no solution. Image processing is hard.
Image Analyst
Image Analyst 2021 年 5 月 11 日
Yes, it can be, which is good for me because that's my whole career and it's good if people think it's hard because they are impressed with my work.
Post your original image if you want.
Kevin
Kevin 2021 年 5 月 11 日
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
imshow(A)
% 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?

サインインしてコメントする。

製品

リリース

R2021a

タグ

質問済み:

2021 年 5 月 11 日

コメント済み:

2021 年 5 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by