Sha256: 57113989308fb7d9cee73cf0e1d54186eebf7db0772eafc9acaa23c7ecb8dc39

Contents?: true

Size: 706 Bytes

Versions: 6

Compression:

Stored size: 706 Bytes

Contents

#!/usr/bin/env ruby -w
require 'rmagick'

# Demonstrate the Image#enhance method

img = Magick::Image.read('images/Flower_Hat.jpg').first

eimg = img.unsharp_mask(3.0, 1.0, 1.0, 0.05)

img.resize!(3)
eimg.resize!(3)

# Make a before-and-after composite
eimg.crop!(eimg.columns / 2, 0, eimg.columns / 2, eimg.rows)
img = img.composite(eimg, Magick::EastGravity, Magick::OverCompositeOp)

# Draw a black line between the before and after parts.
line = Magick::Draw.new
line.line(img.columns / 2, 0, img.columns / 2, img.rows)
line.draw(img)

# Zoom in so we can see the change,
# then crop everything but the face.
img.crop!(Magick::CenterGravity, 250, 200)

# img.display
img.write('unsharp_mask.jpg')
exit

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rmagick-4.1.0.rc2 doc/ex/unsharp_mask.rb
rmagick-4.1.0.rc1 doc/ex/unsharp_mask.rb
rmagick-4.0.0 doc/ex/unsharp_mask.rb
rmagick-3.2.0 doc/ex/unsharp_mask.rb
rmagick-3.1.0 doc/ex/unsharp_mask.rb
rmagick-3.0.0 doc/ex/unsharp_mask.rb