public
Description: Rails plugin for uploading images as resources, with support for resizing, text stamping, and other special effects.
Home | Edit | New

OperatorUnsharpMask

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

Last edited by Squeegy, Sat Apr 05 13:07:22 -0700 2008
Home | Edit | New
Versions: