Sha256: f232a318c1ce805709fb13f065f013a49db6a8b727893df430db02cca16f899f

Contents?: true

Size: 387 Bytes

Versions: 29

Compression:

Stored size: 387 Bytes

Contents

#! /usr/local/bin/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

29 entries across 29 versions & 2 rubygems

Version Path
rmagick-2.13.4 doc/ex/sketch.rb
rmagick-2.13.3 doc/ex/sketch.rb
rmagick-2.13.3.rc1 doc/ex/sketch.rb
rmagick-2.13.2 doc/ex/sketch.rb
rdp-rmagick-0.0.0 doc/ex/sketch.rb
rmagick-2.13.1 doc/ex/sketch.rb
rmagick-2.12.2 doc/ex/sketch.rb
rmagick-2.12.1 doc/ex/sketch.rb
rmagick-2.12.0 doc/ex/sketch.rb
rmagick-2.11.1 doc/ex/sketch.rb
rmagick-2.10.0 doc/ex/sketch.rb
rmagick-2.11.0 doc/ex/sketch.rb
rmagick-2.2.0 doc/ex/sketch.rb
rmagick-2.0.0 doc/ex/sketch.rb
rmagick-2.1.0 doc/ex/sketch.rb
rmagick-2.3.0 doc/ex/sketch.rb
rmagick-2.2.2 doc/ex/sketch.rb
rmagick-2.4.0 doc/ex/sketch.rb
rmagick-2.5.0 doc/ex/sketch.rb
rmagick-2.5.1 doc/ex/sketch.rb