Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Readme.md

SmartCrop

by Peter Sobot (psobot.com) on August 26, 2012. Licensed under MIT.


SmartCrop is a smart JPEG thumbnailing algorithm based on entropy measurements of a sliding window. Based off an algorithm by Michael Macias, SmartCrop was first implemented in Ruby back in April 2012. This solution, however, was dog-slow. (On the order of ~2 seconds per image processed!)

This repo contains three versions of the same basic program:

  • smartcrop.rb, the original Ruby script using RMagick
  • fastcrop, using libJPEG, literally 50 times faster than the Ruby version.
  • smartcrop, using Magick++, which is roughly 6x faster than the Ruby.

Check out the blog post on comparing the three methods.


General Usage

Just make, then run ./smartcrop or ./fastcrop (or ruby smartcrop.rb):

SmartCrop by Peter Sobot
------------------------
Usage: ./smartcrop [-o output_dir] [-d date_from] input_file input_file ...
       Default output directory is the current directory.
       Default date from is forever ago.

About

An intelligent image thumbnailer in C++, using libJPEG and some magic.

Resources

License

Releases

No releases published
You can’t perform that action at this time.