Why does MATLAB play with the contrast of my image after saving it?

조회 수: 3 (최근 30일)
Ali Almakhmari
Ali Almakhmari 2022년 7월 21일
댓글: Ali Almakhmari 2022년 7월 23일
I have a very weird problem that I hope someone can help me with. So Attached are two pictures of almost the exact same location in a map of a desert, one named "true" and one named "weird". The "true" image is the one I have and downloaded directly from the source in a tiff format. And the "weird" image is the true image taken into MATLAB with the following piece of code:
pictureData = imread("true.tiff");
h = imshow(pictureData);
imwrite(h.CData,"weird.tiff")
Now I don't understand why my map's colors are very slightly adjusted after saving the new image where the new image has lighter colors (the colors are almost the same I know...but still there is a noticeable difference that will skew my results)
I would like to do some analysis on my images but I am afraid that MATLAB will ruin my pictures and skew my results with this arbitrary change in colors. Is this because my images are gigantic (>50MB)? Or is it because I am saving those images incorrectly? I don't really know whats going.
  댓글 수: 14
DGM
DGM 2022년 7월 23일
편집: DGM 2022년 7월 23일
I used the code as I posted above. I'm not sure what the difference is.
Difference in version/environment?
Difference between 'true.tiff' and 'true.jpeg'?
What happens if you try to save the file using imwrite() directly on pictureData instead of on h.Cdata?
Ali Almakhmari
Ali Almakhmari 2022년 7월 23일
I tried all your suggestions and they didn't help..except one. I think I will downgrade to MATLAB 2019b and see if it works. I really appreciate all your help. Let me know if you have any further suggestions.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by