Skip to content

OperatorUnsharpMask

Squeegy edited this page Sep 12, 2010 · 3 revisions

unsharp_mask(options = {})

Sharpen an image using an unsharp mask filter. This is just a direct call to RMagick’s unsharp_mask!. The defaults are probably fine for a subtle post-resize sharpening, but RMagick documentation describes the options as follows.

  • :radius
    The radius of the Gaussian operator. Use a radius of 0 and unsharp_mask selects a suitable radius for you. The default is 0.0.
  • :sigma
    The standard deviation of the Gaussian operator. A good starting value is 1.0, which is the default.
  • :amount
    The percentage of the blurred image to be added to the receiver, specified as a fraction between 0 and 1.0. A good starting value is 1.0, which is the default.
  • :threshold
    The threshold needed to apply the amount, specified as a fraction between 0 and 1.0. A good starting value is 0.05, which is the default.

Example

@photo.operate do |image|
  image.unsharp_mask
end

Back to Operators

Clone this wiki locally