Sha256: 9388e4aa411a58f35325404baf6ab00a6f490cbfc492ffcd38234df0e7d0abf3

Contents?: true

Size: 383 Bytes

Versions: 19

Compression:

Stored size: 383 Bytes

Contents

#!/usr/bin/env ruby -w

require 'rmagick'

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

# Convert to grayscale
sketch = img.quantize(256, Magick::GRAYColorspace)

# Apply histogram equalization
sketch = sketch.equalize

# Sketch, then dissolve 25% of the original back in
sketch = sketch.sketch(0, 10, 135)
img = img.dissolve(sketch, 0.75, 0.25)

img.write('sketch.jpg')

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
rmagick-4.1.0.rc2 doc/ex/sketch.rb
rmagick-4.1.0.rc1 doc/ex/sketch.rb
rmagick-4.0.0 doc/ex/sketch.rb
rmagick-3.2.0 doc/ex/sketch.rb
rmagick-3.1.0 doc/ex/sketch.rb
rmagick-3.0.0 doc/ex/sketch.rb
rmagick-windows-2.16.5 doc/ex/sketch.rb
rmagick-windows-2.16.4 doc/ex/sketch.rb
rmagick-windows-2.16.3 doc/ex/sketch.rb
rmagick-windows-2.16.2 doc/ex/sketch.rb
rmagick-windows-2.16.1 doc/ex/sketch.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/doc/ex/sketch.rb
rmagick-2.16.0 doc/ex/sketch.rb
rmagick-2.15.4 doc/ex/sketch.rb
rmagick-2.15.3 doc/ex/sketch.rb
rmagick-2.15.2 doc/ex/sketch.rb
rmagick-2.15.1 doc/ex/sketch.rb
rmagick-2.15.0 doc/ex/sketch.rb
rmagick-2.14.0 doc/ex/sketch.rb