From: Roy on
Dear all,

I have an image represented by matrxi A with 1000*1000.

I use following command:

imwrite(A,'mypicture.png','XResolution',1000,'XResolution',1000);

However, the image is totally white.

Could anybody help?

Thanks.

Roy
From: ImageAnalyst on
Roy:
Try export_fig instead. It's one of the most popular downloads, as
you can now imagine.
http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig
From: Walter Roberson on
Roy wrote:

> I have an image represented by matrxi A with 1000*1000.
>
> I use following command:
>
> imwrite(A,'mypicture.png','XResolution',1000,'XResolution',1000);
> However, the image is totally white.

What is the data class of A ? What is its range of values? Are you
expecting a greyscale image or a color image? If you are expecting a
color image, you should probably use rgb2ind() and pass the color map to
imwrite() explicitly.
From: Oliver Woodford on
"Roy " <chaowu2009(a)gmail.com> wrote in message <hougca$fms$1(a)fred.mathworks.com>...
> Dear all,
>
> I have an image represented by matrxi A with 1000*1000.
>
> I use following command:
>
> imwrite(A,'mypicture.png','XResolution',1000,'XResolution',1000);
>
> However, the image is totally white.
>
> Could anybody help?
>
> Thanks.
>
> Roy

Does the resolution have anything to do with it? What happens if you remove those parameters?

Passing in a double image in the range 0-255 can do this. Try converting to uint8, or dividing by 255.