Skip to content

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

License

Notifications You must be signed in to change notification settings

psobot/smartcrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published