image() and imread() displays lower quality image
32 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sgreess
am 16 Jan. 2019
Bearbeitet: sgreess
am 17 Jan. 2019
Apologies if I'm misusing any image-processing terms; I'm not very familiar with them.
When I display an image in Matlab using the imread() function, the displayed image is noticably lower quality than the original image before I load it into Matlab. To clarify, this doesn't have anything to do with saving an image through Matlab; I am loading an image that when viewed in another image viewing program (Windows Photo Viewer, Adobe Illustrator, etc) seems to have one level of quality, but when loaded and displayed in Matlab seems to lose that quality.
I've attached the original image and a screenshot comparison of the original image (on the left) and Matlab's display of the image (on the right). My code is as follows:
cadPic = imread('original.png');
image(cadPic)
I've tried various combinations of image(), imread(), and imshow(). I've also tried converting the original image from an int8 RGB triplet into a double, with this method:
I've also tried to use the
axis image
command specified by this answer, with no effect. I can manually resize the image in Adobe Illustrator without seeing this kind of quality loss, so I'm not sure if the solution in that answer applies to this case.
2 Kommentare
Walter Roberson
am 16 Jan. 2019
It looks to me to be a challenge with aliasing on lines that are only one pixel wide with an image that is several times screen size.
I am not sure how the other programs are coping with this. It is possible, I suppose, that they have algorithms to detect lines and prioritize those.
I agree that the output leaves rather something to be desired.
Akzeptierte Antwort
Image Analyst
am 16 Jan. 2019
I think the image is just being subsampled for display. If you zoom in you'll probably see all the details. See attached zoom demo.
1 Kommentar
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!