Thursday, March 15, 2012

Gel button with mini_magick

"Gel Button" is also popular effect. And of course, mini_magick can do this effect.

require 'mini_magick'

image ="")
width = image[:width]
height = image[:height]
image.write 'spread4.png'

image_cloned ='spread4.png')
image_cloned.combine_options do |mogrify|
  mogrify.alpha 'off'
  mogrify.blur "#{width}x#{height}"
  mogrify.shade "#{width}x#{height}"
  mogrify.sigmoidal_contrast '8,60%'
  mogrify.evaluate 'multiply', '.5'
  mogrify.roll "+0+#{(height*0.05).to_i}"
image_composed = image_cloned.composite(image) do |c|
  c.compose 'Screen'

image_composed.write 'gel_spread4.png'

This is the original image (from Duck Duck Go).

And, this is the converted one.

No comments:

Post a Comment