nom original du fichier : do_banner.rb

require 'RMagick'
include Magick
 
WIDTH = 790
HEIGHT = 60
 
stripes = ImageList.new
 
top_grad = GradientFill.new(0, 0, WIDTH, 0, "#dddddd", "#888888")
stripes << Image.new(WIDTH, HEIGHT, top_grad)
 
bottom_grad = GradientFill.new(0, 0, WIDTH, 0, "#757575", "#555555")
stripes << Image.new(WIDTH, HEIGHT, bottom_grad)
 
combined_grad = stripes.append(true)
 
color = Image.new(combined_grad.columns, combined_grad.rows) do
         self.background_color = "#87a5ff"
end
 
background = combined_grad.composite(color, CenterGravity, ColorizeCompositeOp)
 
shadow = Image.new(background.columns+10, background.rows+10)
 
gc = Draw.new
gc.fill "gray30"
gc.rectangle 5, 5, background.columns+5, background.rows+5
gc.draw(shadow)
shadow = shadow.blur_image(0, 2)
 
shadowed_background = shadow.composite(background, CenterGravity, OverCompositeOp)
 
shadowed_background.write("top.png")