How to save very large image to original resolution
Show older comments
I have a very large image saved via .tif file (70,499 x 8400). I am trying to plot and fill polygons on this image that are the result from an artifical intelligence neural network (points are in .JSON format). I have no problem plotting the images on the large image, my trouble comes from trying to save the figure to the original resolution. I have tried using export_fig('filename', '-native') but errors keep popping up saying that the image is too large, I have tried using 'imwrite' as well as 'print' with no success. Is there anyway to to achieve this?
3 Comments
I think the preferred method would be to deal directly with the image instead of trusting everything to be preserved from a plot.
That said, it all depends what commands you're actually trying to use. For a uint8 RGB image with said geometry, I can save it using imwrite(), and I don't have much memory.
A = randi([0 255],70499,8400,3,'uint8'); % generate dummy image
imwrite(A,'blah.tif') % save it
CivilEngineer27
on 25 Aug 2021
DGM
on 25 Aug 2021
Since you'd mentioned imwrite(), I was assuming that you had already been able to apply those to the image itself.
I don't know what exactly you're doing with plot tools, but if you're using ROI tools, you can use createMask() and basic image operations to alter the underlying image. If that's something that you need to figure out how to do, I suggest coming up with a reduced-size conceptual example of the things you're trying to embed and we can see what the options are.
Answers (2)
Image Analyst
on 25 Aug 2021
0 votes
Did you try exportgraphics()?
3 Comments
CivilEngineer27
on 26 Aug 2021
Image Analyst
on 26 Aug 2021
Then try export_fig
CivilEngineer27
on 26 Aug 2021
Yair Altman
on 26 Aug 2021
0 votes
Try to use export_fig's sister image-export utility, ScreenCapture: https://www.mathworks.com/matlabcentral/fileexchange/24323-screencapture
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!