The Shattered Machine is a gem that aim to create glitched png images easily.
require 'shattered_machine'
io = ShatteredMachine::Io.new('input_image.png', 'output_folder', 'output_filename')
ShatteredMachine::Glitcher.new('Slim', io).call
require 'shattered_machine'
io = ShatteredMachine::Io.new('input_image.png', 'output_folder', 'output_filename')
ShatteredMachine::Sampler.new(io).call
require 'shattered_machine'
io = ShatteredMachine::Io.new('input_image.jpg', 'output_folder', 'output_filename')
ShatteredMachine::Converter.new(io).call
The Shattered Machine using two main libraries for glitching :
The rusty engine is written in rust and a compiled version for Windows, Mac os and Linux is already included in the gem. To install the needed dependencies you need to install the Ruby language and Bundler.
Then run bundle install
to fetch the needed gems.
lib/shattered_machine.rb
and shattered_machine.gemspec
gem build shattered_machine.gemspec
gem push shattered_machine-x.x.x.gem
This project uses Rspec for writing specs, to run them simply run bundle rspec
This gem is relying heavily on the pnglitch gem and the rusty engine gem. The png image used in the specs has been created with Ronin while the jpg one is painting from Karl Wiener. Icons made by Freepik from www.flaticon.com