File Exchange

image thumbnail

Remove white space around images

version (109 KB) by Reza Farrahi Moghaddam
RemoveWhiteSpace removes white spaces around images.


Updated 14 Feb 2012

View License

RemoveWhiteSpace function is a tiny tool to remove white spaces around an image.


1. For an image: u_out = RemoveWhiteSpace(u_in)

2. For an image file, to overwrite the result on the same file: RemoveWhiteSpace([], 'file', input_filename)

3. For an image file, to make a new output file: RemoveWhiteSpace([], 'file', input_filename, 'output', output_filename)

© February 2nd, 2012, By Reza Farrahi Moghaddam, Synchromedia Lab, ETS, Montreal, Canada

Cite As

Reza Farrahi Moghaddam (2020). Remove white space around images (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)




hi, is this same concept for horizontal projection profile (HPP) and vertical projection profile (VPP)?? HPP & VPP are the step for creating a unoform block of text in preprocessing step for image. I have tried using RemoveWhiteSpace function but it's not working. TQ

Thanks Richard,

I will add Image Processing Toolbox to the requirements for now.

Appears to require Image Processing Toolbox or some internal rewriting to eliminate mat2gray and rgb2gray.


A minor fix.

Removing the dependency on the Image Processing Toolbox.

Image Processing Toolbox is added to requirements.

A minor fix.

A minor fix.

A minor fix.

A minor fix.

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux