MATLAB: Image resizing and saving using imwrite

image reconstructionimwrite

hi…i need to resize the images to 512×512 and then save the image….m using imwrite to save but it saving it as blank images…my code is as below…plz help asap..
a=imread('1.jpg');
b=double(a)+1; %converting uint to double
c=imresize(b, [512 512]);
imwrite(c,'1f.jpg');
figure,imshow(a,[]);
figure,imshow(c,[]);

Best Answer

If you work with images in DOUBLE format, limit the values to the interval [0, 1]. Therefore prefer IM2DOUBLE instead of double(a)+1.
Related Question