Created
October 1, 2018 19:50
-
-
Save ailinykh/a30f0778643f69aa7c73c7d44fb35ffa to your computer and use it in GitHub Desktop.
Dino paintings for your children
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 'open-uri' | |
Dir.mkdir('raskraski') | |
Dir.chdir('raskraski') | |
for i in 1..64 do | |
open("dino#{i}.GIF", 'wb') do |file| | |
file << open("http://raskras-ka.com/wp-content/uploads/Zhivotnye/Dinozavry/raskraski-dinozavry-#{i}.GIF").read | |
end | |
end |
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
source 'https://rubygems.org' do | |
# Gems here | |
gem 'rmagick' | |
end |
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 'rmagick' | |
Dir.mkdir('processed') | |
for i in 1..64 do | |
image = Magick::Image.read("raskraski/dino#{i}.GIF").first | |
gc = Magick::Draw.new | |
gc.fill('white') | |
gc.rectangle(5, image.rows-30, 320, image.rows-5) | |
gc.draw(image) | |
image.write("processed/dino#{i}.GIF") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment