Skip to content

Instantly share code, notes, and snippets.

@axtutuu
Last active November 26, 2016 05:24
Show Gist options
  • Save axtutuu/7f8563b115a5d2e40f946c4ee27e8c83 to your computer and use it in GitHub Desktop.
Save axtutuu/7f8563b115a5d2e40f946c4ee27e8c83 to your computer and use it in GitHub Desktop.
画像、合成テスト
require "rmagick"
require "pry"
base_path = "./4x4.png"
image_path = "./1x1.png"
base = Magick::ImageList.new base_path
image = Magick::ImageList.new image_path
# result_x = 2
# result_y = 2
result2_x = 2.5
result2_y = 2.5
result = base.composite(image, result2_x, result2_y, Magick::OverCompositeOp)
result.write("./result2.png")
# frozen_string_literal: true
source "https://rubygems.org"
gem "rmagick"
gem "pry"
# gem "rails"
GEM
remote: https://rubygems.org/
specs:
coderay (1.1.1)
method_source (0.8.2)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rmagick (2.16.0)
slop (3.6.0)
PLATFORMS
ruby
DEPENDENCIES
pry
rmagick
BUNDLED WITH
1.13.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment