필터 지우기
필터 지우기

How to use imwrite to save imshow(image01, [ ]) as a PNG file ?

조회 수: 27 (최근 30일)
Sandy Winardi
Sandy Winardi 2020년 10월 11일
댓글: Image Analyst 2020년 10월 11일
So, I have an image file: image01.
When I use imshow to show the image, it will look different when I use limit: imshow(image01, [ ]).
When I use imwrite to write the image into a png file: imwrite(image01, "image01.png", "png"), the png file saved is the one when I dont use limit: imshow(image01).
I want to write the image shown when I use " imshow(image01, [ ]) "
Is it possible to do that using imwrite ? or do I have to use other method ?

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 10월 11일
First rescale the image before saving it
img_new = rescale(image01, 0, 1);
imwrite(img_new, "image01.png", "png")
  댓글 수: 3
Ameer Hamza
Ameer Hamza 2020년 10월 11일
I am glad to be of help!!!
Image Analyst
Image Analyst 2020년 10월 11일
Sandy, please "Accept this answer" to thank/award Ameer reputation points for helping you.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by