Shahgee
Shahgee

Reputation: 3405

Difference between imwrite and imsave

//1

I have color matrix(M*N)

and I used imsave to get an image.

figure, imagesc(color matrix), colormap(gray); imsave;

It is simple and works.But I have to give image name to save image each time. How can I pass filename to imsave.

//2 imwrite() does the job what I want to do with imsave. How can I get MAP values(3*3) for gray scale image. Important thing I want to know is what is best imsave or imwrite for better quality image.

Upvotes: 5

Views: 8465

Answers (1)

Jonas
Jonas

Reputation: 74940

If you have a look at the code for imsave (run edit imsave), you'll see that it is basically a wrapper for imwrite that comes with a dialog. In other words, they both will write the same quality image.

To use IMWRITE with a map, use the following syntax:

imwrite(yourImageHere,map,filename)

Upvotes: 3

Related Questions