1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gimpfu import *
# Definition des couleurs a remplacer
green_center_r = pdb.gimp_image_pick_color(image, drawable, 100, 15, FALSE, FALSE, 0)
green_upper_r = pdb.gimp_image_pick_color(image, drawable, 9, 6, FALSE, FALSE, 0)
green_lower_r = pdb.gimp_image_pick_color(image, drawable, 5, 26, FALSE, FALSE, 0)
orange_r = pdb.gimp_image_pick_color(image, drawable, 125, 20, FALSE, FALSE, 0)
# Definition des couleurs a ajouter
light_grey = gimpcolor.RGB(0.8627450980392157, 0.8627450980392157, 0.8627450980392157, 1.0)
# Fonction principale
def xdemat_icon(image, drawable):
pdb.gimp_convert_rgb(image)
suppr_ico(image, drawable, green_center_r)
replace_color(image, drawable, orange_r, light_grey)
#Fonction de suppression d'icone
def suppr_ico(image, drawable, color_r):
pdb.gimp_image_select_rectangle(image, 0, 10, 8, 16, 14)
pdb.gimp_context_set_foreground(color_r)
pdb.gimp_edit_bucket_fill(drawable, 0, 0, 100, 0, FALSE, 10, 10)
pdb.gimp_selection_none(image)
# Fonction permettant de remplacer des couleurs
def replace_color(image, drawable, color_r, color):
pdb.gimp_image_select_color(image, 0, drawable, color_r)
pdb.gimp_context_set_foreground(color)
pdb.gimp_edit_bucket_fill(drawable, 0, 0, 100, 0, FALSE, 10, 10)
pdb.gimp_selection_none(image)
register(
"python-fu-xdemat-icon",
"Creer une icone xDemat a partir d'une existante",
"Creer une icone xDemat en modifiant la couleur et le logo d'une ancienne",
"Guillaume VANDEVELDE",
"Guillaume VANDEVELDE",
"2016",
"/File/Create/Xdemat_icon...",
"*",
[
(PF_IMAGE, "image", "takes current image", None),
(PF_DRAWABLE, "drawable", "Input layer", None),
],
[],
xdemat_icon)
main() |
Partager