https://github.com/jim/unshred
A solution to the Instagram Image Unshredding Challenge.
https://github.com/jim/unshred
Last synced: over 1 year ago
JSON representation
A solution to the Instagram Image Unshredding Challenge.
- Host: GitHub
- URL: https://github.com/jim/unshred
- Owner: jim
- Created: 2011-11-15T00:02:31.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-03-31T20:05:48.000Z (over 14 years ago)
- Last Synced: 2025-01-29T17:24:53.911Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 11.8 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unshred
This is a solution to the [Instagram Image Unshredding Challenge](http://instagram-engineering.tumblr.com/post/12651721845/instagram-engineering-challenge-the-unshredder).
## Requirements
* Ruby 1.9
* ChunkyPNG
* [GraphicsMagick](http://www.graphicsmagick.org/) to run the tests.
All commands assume you are in the project directory, as I haven't
bothered to make this a real gem.
## Usage
This code works well for photographic images, but has some trouble with the old
TV test image.
Shred width detection is supported. To unshred an image:
ruby bin/unshred path_to_image [-o OUTPUT_PATH]
Shredding of normal images is also supported:
ruby bin/unshred path_to_image -s -w SHRED_WIDTH [-o OUTPUT_PATH]
To see the valid shred widths, run the previous command and omit the
`-w` option.
## Tests
ruby test/unshred_test.rb
There is currently one failing test (the TV test image).