Class: XCUtils::XCUtilsImage

Inherits:
Object
  • Object
show all
Defined in:
lib/XCUtils/xcutils_image.rb

Class Method Summary collapse

Class Method Details

.scale_image(image, scale) ⇒ Object

resize image by scale utilizing Mitchell filter and slightly blurrying



8
9
10
11
12
13
14
15
# File 'lib/XCUtils/xcutils_image.rb', line 8

def self.scale_image(image, scale)
  w = image.columns
  h = image.rows
  scale != 1.0 ? image.resize(w * scale, h * scale, Magick::HammingFilter,0.9) : image
  # image.scale(scale)
  # image.resize(w * scale, h * scale, Magick::BoxFilter)
  #.unsharp_mask(1.5, 1.0, 0.5, 0.02)
end