When I display a bitmap image using image
in a Matlab figure window, I'm experiencing strange artifacts:
What I'm referring to are the cross-shaped structures which are particularly visible at the edges of the brain slice, but present throughout.
These structures are not in the underlying image data, which are exactly identical to those in this image:
I assume the artifacts have to do with the slight rescaling that is necessary to match the image to the given axes size.
Does someone have an idea how to avoid these artifacts? I tried changing the figure 'Renderer'
, which does indeed affect the artifact, but does not let it vanish.
How to reproduce the effect:
save the second image as "image.png"
execute:
im = imread('image.png'); image(im) set(gca, 'Units', 'pixels') set(gca, 'Position', [76.1094204520027 576.387782501678 343.969568136048 357.502797046319])
maximize the figure window, so that the axes with the image becomes visible
Native image dimensions are 306 x 318, but it is displayed at about 344 x 358 pixels.
I did some further experiments and found that the effect is not specific to this image, the particular positioning, or the colormap:
[x, y] = meshgrid(-1:0.01:1);
imagesc(cos(10*sqrt(x.^2 + y.^2)))
giving
for a specific size of the figure window shows the same kind of artifacts.
It would be interesting to know whether the artefact is specific to my Matlab version (2013a) or platform (Debian Linux, kernel 3.14 with NVidia graphics).
imshow
and there aren't any edge artifacts that you showed. I'll have a look and will get back to you. – Indreetloireaxis equal
so that the aspect ratio of the image is the same as the original. Let me know if that works. Run this command right after your list of commands in your post – Indreetloireimage(im), axis equal
. If I then resize the figure window manually, the artifacts change, but remain, until the window is much larger. – Just to be sure, you see the same effect on your system, right? – Lw