MATLAB Answers

Why is imshow() not showing my image correctly?

53 views (last 30 days)
lohit madiwal
lohit madiwal on 4 Feb 2016
Edited: lohit madiwal on 4 Feb 2016
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');
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.
lohit madiwal
lohit madiwal on 4 Feb 2016
I converted the image to bitmap. This is the image.
I recieved the output as following:
The output is as expected.

Sign in to comment.

Accepted Answer

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

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!