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.15.4 doc/ex/add_noise.rb
rmagick-1.15.5 doc/ex/add_noise.rb
rmagick-1.15.6 doc/ex/add_noise.rb
rmagick-1.15.7 doc/ex/add_noise.rb
rmagick-1.15.8 doc/ex/add_noise.rb
rmagick-1.7.2 doc/ex/add_noise.rb
rmagick-1.15.9 doc/ex/add_noise.rb
rmagick-1.7.1 doc/ex/add_noise.rb
rmagick-1.7.3 doc/ex/add_noise.rb
rmagick-1.7.4 doc/ex/add_noise.rb
rmagick-1.8.0 doc/ex/add_noise.rb
rmagick-1.8.1 doc/ex/add_noise.rb
rmagick-1.9.2 doc/ex/add_noise.rb
rmagick-1.8.2 doc/ex/add_noise.rb
rmagick-1.8.3 doc/ex/add_noise.rb
rmagick-1.9.0 doc/ex/add_noise.rb
rmagick-1.9.1 doc/ex/add_noise.rb
rmagick-1.9.3 doc/ex/add_noise.rb