Why is imshow() not showing my image correctly?

16 Ansichten (letzte 30 Tage)
lohit madiwal
lohit madiwal am 4 Feb. 2016
Kommentiert: DGM am 8 Okt. 2025
Good day everyone. This is the image i have.
The name of the image is white_circles. It is a .png format image.
This is my code.
im = imread('white_circles.png');
imshow(im);
This is the output.
What is happening here? When i try the same with .jpg everything works fine. Is this issue related to the format of the image or is it due to something else?
Please help me out. Thank you.
  2 Kommentare
KSSV
KSSV am 4 Feb. 2016
Try converting png into tiff/ bitmap and use the same lines of code.
lohit madiwal
lohit madiwal am 4 Feb. 2016
I converted the image to bitmap. This is the image.
I recieved the output as following:
The output is as expected.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KSSV
KSSV am 4 Feb. 2016
You have to use the following
[im,map] = imread('white_circles.png');
imshow(im,map);
  2 Kommentare
lohit madiwal
lohit madiwal am 4 Feb. 2016
Bearbeitet: lohit madiwal am 4 Feb. 2016
Could you please explain as to why the above process should be done sir? It works.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by