Image Processing Toolbox User's Guide Previous page   Next Page

Specifying the Initial Image Magnification

Like imshow, the imtool function attempts to display an image in its entirety at 100% magnification (one screen pixel for each image pixel). Unlike imshow, imtool always honors the specified numeric magnification, showing only a portion of the image if it is too big to fit in a figure on the screen and adding scroll bars to allow navigation to parts of the image that are not currently visible. If the specified magnification would make the image too large to fit on the screen, imtool scales the image to fit, without issuing a warning. This is the default behavior, specified by the imtool 'InitialMagnification' parameter value 'adaptive'.

To override this default initial magnification behavior for a particular call to imtool, specify the InitialMagnification parameter. For example, to view an image at 150% magnification, use this code.

You can also specify the text string 'fit' as the initial magnification value. In this case, imtool scales the image to fit the default size of a figure window.

You can also change the default initial magnification behavior of imtool by setting the ImtoolInitialMagnification toolbox preference. The magnification value you specify affects every call to imtool for the current MATLAB session. To make this preference persist between sessions, include the command to set the preference in your startup.m file. To learn more about toolbox preferences, see Setting the Values of Toolbox Preferences.

When imtool scales an image, it uses interpolation to determine the values for screen pixels that do not directly correspond to elements in the image matrix. For more information, see Interpolation.


Previous page  Opening the Image Tool Specifying the Colormap Next page

© 1994-2005 The MathWorks, Inc.