Nouvelle bannière !
Par guiguilinux |
vendredi 30 juin 2006 à 16:35 | General
| #9
| rss
L'ancienne bannière du blog était un dégradé vite fait sous Gimp, et n'était pas terrible ... La nouvelle a été réalisé à l'aide de Ruby et de la lib image magick, et rend tout de même mieux ;-) Le code qui en est à l'origine est joint dans le corps de l'article, pour les codeurs intéressés.
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")
Commentaires
1. Le vendredi 30 juin 2006 à 16:39, par guiguilinux
2. Le vendredi 30 juin 2006 à 20:00, par guiguilinux
3. Le samedi 1 juillet 2006 à 11:16, par jean-mi
4. Le samedi 1 juillet 2006 à 13:13, par guiguilinux
5. Le dimanche 2 juillet 2006 à 16:26, par jean-mi
Ajouter un commentaire
Les commentaires pour ce billet sont fermés.