GUI Imshow Quality Loss

10 views (last 30 days)
James Clancy
James Clancy on 27 Apr 2020
Answered: Rahul on 4 Dec 2024
Hello, I am trying to create a high quality image background for my GUI using the UIAxes method. However, even when I get the picture to the same size of the axes, the quality is lowered. I also cannot figure out how to get the fix specified here to work: https://www.mathworks.com/matlabcentral/answers/342392-quality-for-image-in-matlab-gui
Does anyone have a suggestion/prior experience getting a high quality background image on their GUI?

Answers (1)

Rahul
Rahul on 4 Dec 2024
To obtain high quality images on a 'UIaxis', the following MATLAB Answer suggests scaling the axis based on the true size of the image incase 'image' or 'imagesc' functions are being used.
Here is an example:
im1 = imread('im1.png');
imagesc(im1);
axis image
Alternatively, 'imshow' function can be used to display an image on a 'UIaxis'. This function provides properties like 'InitialMagnification' and 'Interpolation' which can be used to improve the scaling of the image. Here is an example:
figure;
ax = axes;
imshow('im1.png', 'Parent', ax);
title('Original Image');
figure;
ax1 = axes;
imshow('im1.png', 'Parent', ax1, 'InitialMagnification', 'fit', 'Interpolation', 'bilinear');
title('Image after bilinear interpolation');
This is also mentioned in detail in this MATLAB Answer:
The following MathWorks documentations can be referred to know more:
Thanks.

Categories

Find more on Display Image in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!