class Pixitar::Image
Attributes
image[R]
image_lib[R]
Public Class Methods
new(image_lib = ChunkyPNG::Image, height = 400, width = 400)
click to toggle source
# File lib/pixitar.rb, line 9 def initialize(image_lib = ChunkyPNG::Image, height = 400, width = 400) @image_lib = image_lib @image = image_lib.new(height, width) end
Public Instance Methods
compose(filename)
click to toggle source
# File lib/pixitar.rb, line 14 def compose(filename) canvas = image_lib.from_file(filename) image.compose!(canvas, 0, 0) end
save(filename)
click to toggle source
# File lib/pixitar.rb, line 19 def save(filename) image.save(filename, interlace: true) end