0

I need to create a darken version of an image. What is the correct way to accomplish this? I have tried with the 'modulate' method:

manipulate! do |img|
  img.modulate(0.85)
end

but the result is not optimal (see Result link).

Original Result

MegaTux
  • 1,591
  • 21
  • 26

1 Answers1

1

RMagick Transformation Script has a darken method which may be better suited to this:

img.darken      # darkens the image 25%.
img.darken 0.40 # darkens the image 40%.
siame
  • 8,347
  • 3
  • 25
  • 26
  • I think this method is from an asset_compiler gem class (RMagickTransformationScript), not from RMagick, but I've taken the code from that methods (darken & tilt) and it works beautifully (use colorize method). Thanks a lot! – MegaTux May 17 '13 at 17:40