Sha256: e93123864b87e53f34f9d15bb45add5de5324bab68bc25b29003495047ae69b6

Contents?: true

Size: 436 Bytes

Versions: 38

Compression:

Stored size: 436 Bytes

Contents

#! /usr/local/bin/ruby -w
require 'RMagick'
include Magick

# Demonstrate the Image#add_noise method
NOISE_TYPES = [UniformNoise, GaussianNoise,
               MultiplicativeGaussianNoise,
               ImpulseNoise, LaplacianNoise,
               PoissonNoise]

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

NOISE_TYPES.each do |noise|
    copy = img.add_noise(noise)
    copy.write "add_noise_#{noise.to_s}.jpg"

end
exit

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
rmagick-1.10.1 doc/ex/add_noise.rb
rmagick-1.10.0 doc/ex/add_noise.rb
rmagick-1.12.0 doc/ex/add_noise.rb
rmagick-1.13.0 doc/ex/add_noise.rb
rmagick-1.11.0 doc/ex/add_noise.rb
rmagick-1.11.1 doc/ex/add_noise.rb
rmagick-1.15.0 doc/ex/add_noise.rb
rmagick-1.15.10 doc/ex/add_noise.rb
rmagick-1.14.0 doc/ex/add_noise.rb
rmagick-1.14.1 doc/ex/add_noise.rb
rmagick-1.15.1 doc/ex/add_noise.rb
rmagick-1.15.13 doc/ex/add_noise.rb
rmagick-1.15.15 doc/ex/add_noise.rb
rmagick-1.15.11 doc/ex/add_noise.rb
rmagick-1.15.12 doc/ex/add_noise.rb
rmagick-1.15.14 doc/ex/add_noise.rb
rmagick-1.15.17 doc/ex/add_noise.rb
rmagick-1.15.2 doc/ex/add_noise.rb
rmagick-1.15.16 doc/ex/add_noise.rb
rmagick-1.15.3 doc/ex/add_noise.rb