Skip to content

Instantly share code, notes, and snippets.

@ailinykh
Created October 1, 2018 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ailinykh/a30f0778643f69aa7c73c7d44fb35ffa to your computer and use it in GitHub Desktop.
Save ailinykh/a30f0778643f69aa7c73c7d44fb35ffa to your computer and use it in GitHub Desktop.
Dino paintings for your children
#!/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
source 'https://rubygems.org' do
# Gems here
gem 'rmagick'
end
#!/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