21
21
from gimpfu import *
23
def python_clothify(timg, tdrawable, bx=9, by=9,
24
azimuth=135, elevation=45, depth=3):
23
def clothify(timg, tdrawable, bx=9, by=9, azimuth=135, elevation=45, depth=3):
25
24
width = tdrawable.width
26
25
height = tdrawable.height
27
27
img = gimp.Image(width, height, RGB)
29
30
layer_one = gimp.Layer(img, "X Dots", width, height, RGB_IMAGE,
31
32
img.add_layer(layer_one, 0)
32
33
pdb.gimp_edit_fill(layer_one, BACKGROUND_FILL)
33
35
pdb.plug_in_noisify(img, layer_one, 0, 0.7, 0.7, 0.7, 0.7)
34
37
layer_two = layer_one.copy()
35
38
layer_two.mode = MULTIPLY_MODE
36
39
layer_two.name = "Y Dots"
37
40
img.add_layer(layer_two, 0)
38
42
pdb.plug_in_gauss_rle(img, layer_one, bx, 1, 0)
39
43
pdb.plug_in_gauss_rle(img, layer_two, by, 0, 1)
41
47
bump_layer = img.active_layer
42
49
pdb.plug_in_c_astretch(img, bump_layer)
43
50
pdb.plug_in_noisify(img, bump_layer, 0, 0.2, 0.2, 0.2, 0.2)
44
51
pdb.plug_in_bump_map(img, tdrawable, bump_layer, azimuth,
45
elevation, depth, 0, 0, 0, 0, TRUE, FALSE, 0)
52
elevation, depth, 0, 0, 0, 0, True, False, 0)
50
"Make the specified layer look like it is printed on cloth",
58
"Make the image look like it is printed on cloth",
51
59
"Make the specified layer look like it is printed on cloth",
52
60
"James Henstridge",
53
61
"James Henstridge",
55
"<Image>/Python-Fu/Alchemy/_Clothify",
58
(PF_INT, "x_blur", "X blur", 9),
59
(PF_INT, "y_blur", "Y blur", 9),
66
(PF_INT, "x-blur", "X blur", 9),
67
(PF_INT, "y-blur", "Y blur", 9),
60
68
(PF_INT, "azimuth", "Azimuth", 135),
61
69
(PF_INT, "elevation", "Elevation", 45),
62
70
(PF_INT, "depth", "Depth", 3)
73
clothify, menu="<Image>/Filters/Artistic")