How to save an image without axis or white space?
I am currently trying to save an image adn then reopen that image in MATLAB. I am running into an issue that when I save that image it is saving with the axis. This then causes me to reopen the image and have the image be a different diemnsion due to the axis saving. I have then turned off the axis as peopel have recommended from readings other comments on similar problems. However, when I turn off the axis, then the space where the axis used to be saves as white space on my image. I want to open the image and save the image as the same size. I have attached a few pictures of what the image saving looks like. I have attahced the orgional image called square, the working image which is the image without after saved and reopened in MATLAB, and then the same thing hapening wiht the axis which is the screen shot.
Attached below is also my current code for this section of my code.
set(gca, ‘Visible’, ‘off’);
saveas(gcf,’working_image.jpg’);
close all
img = imread(‘working_image.jpg’); % Replace with your image fileI am currently trying to save an image adn then reopen that image in MATLAB. I am running into an issue that when I save that image it is saving with the axis. This then causes me to reopen the image and have the image be a different diemnsion due to the axis saving. I have then turned off the axis as peopel have recommended from readings other comments on similar problems. However, when I turn off the axis, then the space where the axis used to be saves as white space on my image. I want to open the image and save the image as the same size. I have attached a few pictures of what the image saving looks like. I have attahced the orgional image called square, the working image which is the image without after saved and reopened in MATLAB, and then the same thing hapening wiht the axis which is the screen shot.
Attached below is also my current code for this section of my code.
set(gca, ‘Visible’, ‘off’);
saveas(gcf,’working_image.jpg’);
close all
img = imread(‘working_image.jpg’); % Replace with your image file I am currently trying to save an image adn then reopen that image in MATLAB. I am running into an issue that when I save that image it is saving with the axis. This then causes me to reopen the image and have the image be a different diemnsion due to the axis saving. I have then turned off the axis as peopel have recommended from readings other comments on similar problems. However, when I turn off the axis, then the space where the axis used to be saves as white space on my image. I want to open the image and save the image as the same size. I have attached a few pictures of what the image saving looks like. I have attahced the orgional image called square, the working image which is the image without after saved and reopened in MATLAB, and then the same thing hapening wiht the axis which is the screen shot.
Attached below is also my current code for this section of my code.
set(gca, ‘Visible’, ‘off’);
saveas(gcf,’working_image.jpg’);
close all
img = imread(‘working_image.jpg’); % Replace with your image file opening image, saving image MATLAB Answers — New Questions