How to save the proceesed image in the same size as input image

2 ビュー (過去 30 日間)
MechenG
MechenG 2025 年 5 月 3 日
コメント済み: MechenG 2025 年 5 月 3 日
Hi,
I need to save the proceesed image in the same size (width and height) as the input image. I tried below script, but it still saves teh image in the smaller size than the input same.
width=2472;
height=2062;
set(gcf,'position',[x0,y0,width,height])
  3 件のコメント
MechenG
MechenG 2025 年 5 月 3 日
I just pasted only the part of my code which is dealing the image size.
MechenG
MechenG 2025 年 5 月 3 日
And I need to save my image without any axis. For this I am using axis off command

サインインしてコメントする。

採用された回答

Matt J
Matt J 2025 年 5 月 3 日
outputImage=imresize(outputImage,OutputSize=size(inputImage));
imwrite(outputImage , filename);
  6 件のコメント
Image Analyst
Image Analyst 2025 年 5 月 3 日
You could do it more simply like this:
outputImage = mat2gray(GMag); % Convert to gray scale image in the range 0-1.
imwrite(outputImage, 'output.png'); % Will save as PNG in the range 0-255.
No need for calling im2uint8(), and ind2rgb(), and gray(), unless for some reason you wanted your grayscale image to be a true color RGB image (but still appearing as grayscale).
MechenG
MechenG 2025 年 5 月 3 日
This is good!. Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModify Image Colors についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by