A utility to compress images, with interesting Richter-esque blur effects at high compression.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install image_svd
A prerequisite is to have imagemagick, and a ruby version 1.9.2 or greater installed.
image_svd -i ~/Downloads/svd_photos/in_RichterfuneralM.jpg -n 10
will create a new image in the current directory using 10 singular values.
Be warned! Compression is by no means quick! A 200x300 image takes 15 seconds on my computer. Finding the eigenvalues of a matrix is no easy computational task (O(n!) by brute force, O(n2.3) by super fancy approximation).
You may also specify a (ruby-style inclusive) range of singular values to output images with, ex:
image_svd -i ~/Downloads/svd_photos/in_RichterfuneralM.jpg -n 1..10
This will lead to 10 images being output, and it is 10 times faster than calling the command 10 times since the most costly step (finding eigenvalues) is only done once.
- Fork it ( http://github.com/
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request