Code covered by the BSD License  

Highlights from
crop whitespace from an image

5.0

5.0 | 6 ratings Rate this file 31 Downloads (last 30 days) File Size: 1.94 KB File ID: #20427

crop whitespace from an image

by Andrew Bliss

 

24 Jun 2008 (Updated 25 Jun 2008)

CROP gets rid of whitespace around an image

| Watch this File

File Information
Description

CROP('filename.ext') crops the image in the file and saves it using
  the original filename (overwrites the old image). The extension (ext)
  can be anything IMREAD supports.

  CROP('filename.ext',1) saves the cropped image as filenamecropped.ext
  in the same directory as the original.

  Changes since version 1:
      1. Now accepts directories as input.
      2. Just prior to saving version 1, I added the 'filenamecropped' option.

  Example:
      crop('C:\MATLAB7\toolbox\matlab\demos\html\cruller_01.png',1)

  See also: IMREAD, IMWRITE

  Requirements: your FIND must allow the 'last' option (version 7+?)
  Copyright Andy Bliss Sept 8th, 2006

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (8)
31 Aug 2008 Tom Close

Saved me pulling my hair out trying to work this out!

23 Feb 2009 clayton

Great little *.m file!
Modified it a bit, but more-or-less ready to go.
Thanks a bunch!

22 May 2010 Maider Marin

very usefull, Thanks

09 Sep 2010 Mike Hoff

Wow! This just saved me a wealth of time, Thank you so much!!! No more opening each image one by one in Picture Manager and manually cropping

04 Oct 2010 curran eggertson

I wish I had found this earlier. This could have saved me manually cropping about 300 images already, but atleast still saves the next 700.

24 Dec 2010 even coil

very helpful, thank you

10 Mar 2011 Maja

Thank you, thank you, thank you!

13 May 2011 Mohsen Jamali

Works very nice, thanks.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
crop Andrew Bliss 22 Oct 2008 10:07:12
whitespace Andrew Bliss 22 Oct 2008 10:07:12
image Andrew Bliss 22 Oct 2008 10:07:12
whitespace Arjan van der Leest 07 Sep 2011 10:55:04

Contact us at files@mathworks.com