-1

First and second images are displayed damaged Output for three images

First original image enter image description here Second original image enter image description here

I have two .bmp images and I want to show them in two different axes in a Matlab GUI.

function pushbutton1_Callback(hObject, eventdata, handles) 

[imagedata1 imagemap1] = imread('C0.bmp');

axes (handles.axes1);

imshow(imagedata1, imagemap1);

[imagedata2 imagemap2] = imread('C1.bmp');

axes (handles.axes2);

imshow(imagedata2, imagemap2);

When I run this code, only the second image looks like its original appearance. The first one looks damaged.
When I try this for more than two images, again only the last one looks like its original appearance and the others look damaged.

What is the reason of that? How could I solve this problem?

ffttyy
  • 853
  • 2
  • 19
  • 49
  • I cannot reproduce your problem. For me, your code works fine. Please note: Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – Schorsch Aug 05 '14 at 11:31
  • @Schorsch I added an image – ffttyy Aug 05 '14 at 11:46
  • And this behaviour is related to the code-snippet in your question? Again, with the code you show I **cannot** reproduce a damaging effect on the images. – Schorsch Aug 05 '14 at 11:56
  • @Schorsch I added original images so you can understand mean of 'damaged'. And one more thing, my code-snippet for two image but I added screenshot include two image to make clear my problem. – ffttyy Aug 05 '14 at 12:21

1 Answers1

0

I convert my .bmp images to .png format and then use imshow to display them. Then my problem was solved.

ffttyy
  • 853
  • 2
  • 19
  • 49