MATLAB: Loading in png file that is black

image analysisimage processingMATLAB

Hello,
I am trying to load in a large png file in Matlab with purposes of cropping it (I have a bunch of them so am trying to automate the cropping). Unfortunately, when I load in the images, I first get the message that the image is too large to display, hence Matlab displays at 67% which does not seem to be a problem for the quality of the images. The bigger problem, however, is that the image shows up in black.
I using the following code:
ToCrop = imread('iteration 31.png','png');
imshow(ToCrop,[]);
Thanks!

Best Answer

By saying that the image appears in black, do you mean that the image is still visible but the image is in grey scale?? The below code works fine for me in that case:
[I,m]=imread('iteration 31.png');
imshow(I,'Colormap',m);
Related Question