Method: Magick::Image#matte_replace

Defined in:
lib/rmagick_internal.rb

#matte_replace(x, y) ⇒ Object

Make transparent all pixels that are the same color as the pixel at (x, y).



940
941
942
943
944
945
# File 'lib/rmagick_internal.rb', line 940

def matte_replace(x, y)
  f = copy
  f.alpha(OpaqueAlphaChannel) unless f.alpha?
  target = f.pixel_color(x, y)
  f.transparent(target)
end