File Exchange

image thumbnail

saveasExact(I,filen​ame,format,dims)

version 1.0.0.0 (2.26 KB) by Bogdan Dzyubak
Save image to jpg/tiff/png with exact dimensions/no broder

2 Downloads

Updated 03 Jul 2017

View License

A wrapper function to save matrices/figures as jpg, tiff, png and other formats using exact pixel dimensions and without the white border. Core save as and print functions generally rescale the image and add a white border (e.g. 256x256 becomes 1500x900) which can be inconvenient for quantitative applications such as generating inputs to machine learning. This function is a convenience wrapper based on MatlabCentral and StackOverflow answers about this issue.

Cite As

Bogdan Dzyubak (2020). saveasExact(I,filename,format,dims) (https://www.mathworks.com/matlabcentral/fileexchange/63616-saveasexact-i-filename-format-dims), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

Updates

1.0.0.0

Added set(gca,'position',[0 0 1 1],'units','normalized') to do tight figure fit on Matlab installs not set up to always fit tightly.

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags