How to save an image from imshow() as a .jpeg?
5 ビュー (過去 30 日間)
古いコメントを表示
I am creating an RGB image and displaying using imshow(). Once the image is displayed, if I save the image as .jpeg, it gets a white background to it and the image dimensions change. How can I keep it to its original dimensions? Attached image is what I got when I saved it as a .jpeg file and the dimensions are 240x170. Whereas the original dimensions of the constituting matrices are 100x100.
0 件のコメント
採用された回答
Walter Roberson
2017 年 3 月 18 日
編集済み: Walter Roberson
2017 年 3 月 18 日
Have a look at print(), which pays attention to the figure PaperPosition* properties and to the figure InvertHardcopy property. It also allows a -r resolution option.
However, I would instead recommend using imwrite of the rgb matrix.
その他の回答 (1 件)
Dariush Ashtiani
2018 年 10 月 3 日
You can use saveas commad. Say
filename='image1'; saveas(gcf,[filename,'.jpg'])
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!