www.gusucode.com > images 案例代码 matlab源码程序 > images/ResizeIndexedImageExample.m

    %% Resize Indexed Image
% 
%%
% Read image into the workspace.

% Copyright 2015 The MathWorks, Inc.

[X, map] = imread('trees.tif');
%%
% Resize the image, specifying a scale factor. By default, |imresize|
% returns an optimized color map with the resized indexed image.
[Y, newmap] = imresize(X, map, 0.5);
%%
% Display the original image and the resized image.
figure
imshow(X,map)
title('Original Image')
figure
imshow(Y,newmap)
title('Resized Image')