Cropping an Image with draggable rectangle

Crops the Image from a draggable rectangle & displays it (after the figure is closed)
2.9K Downloads
Updated 24 Apr 2008

View License

% Crops the Image from a draggable rectangle
% & returns the Cropped Image and its co-ordinates
%
% I is the Image to be cropped assumed to be in the
% matlab workspace
%
% w : width (default value : cols/2)
% h : height (default value : rows/2)
%
% EXAMPLES
%
% I = imread('circuit.tif');
% [O] = Crop_it(I);
%
% [O I_crop]=Crop_it(I,0);
%
% [O I_crop]=Crop_it(I,1,100,100);

Cite As

Shripad Kondra (2026). Cropping an Image with draggable rectangle (https://se.mathworks.com/matlabcentral/fileexchange/17460-cropping-an-image-with-draggable-rectangle), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0

To enable initializing the rectangle by hand.