Last active
December 25, 2015 05:29
-
-
Save campanalbero/6924815 to your computer and use it in GitHub Desktop.
ImageMagick を Ruby から使う。フォルダ内の png をトリミングして、 tmp フォルダに同名ファイルで保存する。
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
require 'rubygems' | |
require 'mini_magick' | |
Dir.glob('*.png') do |f| | |
image = MiniMagick::Image.open(f); | |
image.crop("752x422+229+206") | |
image.write('tmp/' + f) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment