Q:

Matlab Imread resizes tif file

so I'm using the imread function in matlab and when I save the TIFF file and open it in photoshop, it has a white border and I can't understand why. I want to maintain its resolution as a 512 by 512 image. Any ideas why? And how I can fix that?
Here's a sample code:
B = imread('W_noise1.tif');

for n = 1:5,
    B = medfilt2(B);
end

B = filter2(fspecial('average',3),B)/255;

imshow(B)

A:

Are you sure it's an issue with imread?  I'd be surprised if it is.
See this link about medfilt2 where it explains that "medfilt2 pads the image with 0s on the edges, so the median values for the points within [m n]/2 of the edges might appear distorted."
EDIT:  I tried to replicate your problem.  This is an issue with print where it puts a white frame around the image after you save it.  This functionality, print is made for printing plots.  If you want to save the image, you should use imwrite.

