5.0

5.0 | 1 rating Rate this file 197 downloads (last 30 days) File Size: 4.03 KB File ID: #22093

print2im

by Oliver Woodford

 

14 Nov 2008 (Updated 14 Apr 2009)

Code covered by BSD License  

Save or output figures to anti-aliased images with cropped borders and optional transparency.

Download Now | Watch this File

File Information
Description

PLEASE NOTE - This function has now been superseded by EXPORT_FIG, which encompasses all its functionality plus some further functionality. This function will therefore no longer receive any support. EXPORT_FIG can be downloaded from:
http://www.mathworks.com/matlabcentral/fileexchange/23629

PRINT2IM outputs a rasterized figure to an array or image file, with:
   - Figure borders cropped
   - Anti-aliased graphics
   - Transparent background (optional)

PRINT2IM takes an optional target filename and/or output variable, and an optional figure handle. Transparency of the background is available through an optional flag. The output image is exactly the size and layout of the figure on the screen.

The image file type is determined by the extension of the filename. If there is no valid extension (".png", ".jpg", ".tif" or ".bmp") then the default extension, ".png", is added. Note that transparency is only supported with png output.

PRINT2IM is especially useful for saving 3-d graphics to a high quality bitmap, for inclusion in a publication or presentation.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Myaa - My Anti-Alias for Matlab
This submission has inspired the following:
export_fig

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
17 Jan 2009 Koray S. Erer

"The output image is exactly the size and layout of the figure on the screen." Just what I needed.

Please login to add a comment or rating.
Updates
15 Nov 2008

Use bilinear interpolation (previously bicubic) for smoother output & faster rendering.

18 Nov 2008

Generalized to output to several image formats and output to an array if wanted. Name changed from PRINT_PNG as a result.

01 Dec 2008

Avoid changing figure position units

26 Jan 2009

Added support for transparency

26 Jan 2009

Faster rendering with transparency, especially without IPT.

28 Jan 2009

Bug fix to output alphamatte when IPT not available

12 Feb 2009

Pass figure handle to print as a double, not a string. Allow printing of gui elements.

14 Apr 2009

Superseded by EXPORT_FIG

Tag Activity for this File
Tag Applied By Date/Time
data export Cristina McIntire 14 Nov 2008 13:29:14
image Cristina McIntire 14 Nov 2008 13:29:14
anti alias Oliver Woodford 14 Nov 2008 13:29:25
export figure Oliver Woodford 14 Nov 2008 13:29:25
bitmap Oliver Woodford 14 Nov 2008 13:29:25
png Oliver Woodford 14 Nov 2008 13:29:25
save Oliver Woodford 14 Nov 2008 13:29:25
print Oliver Woodford 14 Nov 2008 13:29:25
figure Oliver Woodford 14 Nov 2008 13:29:25
image Oliver Woodford 14 Nov 2008 13:29:25
export data Oliver Woodford 14 Nov 2008 13:29:25
data export Oliver Woodford 14 Nov 2008 13:29:25
jpg Oliver Woodford 18 Nov 2008 14:40:32
jpeg Oliver Woodford 18 Nov 2008 14:40:32
tif Oliver Woodford 18 Nov 2008 14:40:32
bmp Oliver Woodford 18 Nov 2008 14:40:32
tiff Oliver Woodford 18 Nov 2008 14:40:32
transparent background Oliver Woodford 26 Jan 2009 17:58:10
transparency Oliver Woodford 26 Jan 2009 17:58:10
transparent Oliver Woodford 26 Jan 2009 17:58:10
presentation Oliver Woodford 27 Jan 2009 09:54:41
powerpoint Oliver Woodford 27 Jan 2009 09:54:47
ppt Oliver Woodford 27 Jan 2009 09:54:52
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com