Created
May 5, 2014 21:00
-
-
Save helloitszak/ebac0ceca4ee42eabf09 to your computer and use it in GitHub Desktop.
Extract Emoji from G+ Hangouts Sprite Sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'free-image' | |
require 'ruby-progressbar' | |
image = FreeImage::Bitmap.open(ARGV[0]) | |
count = (image.height + 1) / 29 | |
pb = ProgressBar.create(:title => "Scaling", :total => count) | |
count.times do |i| | |
#puts i | |
top = i * 29 | |
bottom = top + 28 | |
image.copy(0,top,28,bottom) do |face| | |
# :box is for shitty scaling | |
face.rescale(500,500,:bicubic).save("bicubic/#{i}.png", :png) | |
pb.increment | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment