What is the purpose of the ResolutionUnit property of the TIFF object in MATLAB 7.10 (R2010a)?

9 views (last 30 days)
I would like to specify the XResolution and YResolution for my TIFF image as pixels per inch. However when I set the XResolution and YResolution tags, those settings do not scale the image as I expect.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Jun 2011
This change has been incorporated into the documentation in Release 2011a (R2011a). For previous releases, read below for any additional information:
In order for the XResolution and YResolution settings to be effective, you also need to specify a value for the ResolutionUnit tag.
For example:
t= tiff('myimage.tiff', 'w');
tags.ResolutionUnit = Tiff.ResolutionUnit.Inch;
tags.XResolution = 300; % 300 dpi in the X direction
tags.YResolution = 300; % 300 dpi in the Y direction
t.setTag(tags);
Other valid values for the 'ResolutionUnit' property are:
Tiff.ResolutionUnit.None % image ignores XResolution and YResolution tags
Tiff.ResolutionUnit.Centimeter % resolution in dots per cm

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2010a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!