~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/pygimp/plug-ins/clothify.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import math
21
21
from gimpfu import *
22
22
 
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
 
26
 
27
27
    img = gimp.Image(width, height, RGB)
28
28
    img.disable_undo()
 
29
 
29
30
    layer_one = gimp.Layer(img, "X Dots", width, height, RGB_IMAGE,
30
31
                           100, NORMAL_MODE)
31
32
    img.add_layer(layer_one, 0)
32
33
    pdb.gimp_edit_fill(layer_one, BACKGROUND_FILL)
 
34
 
33
35
    pdb.plug_in_noisify(img, layer_one, 0, 0.7, 0.7, 0.7, 0.7)
 
36
 
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)
 
41
 
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)
 
44
 
40
45
    img.flatten()
 
46
 
41
47
    bump_layer = img.active_layer
 
48
 
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)
 
53
 
46
54
    gimp.delete(img)
47
55
 
48
56
register(
49
 
        "python_fu_clothify",
50
 
        "Make the specified layer look like it is printed on cloth",
 
57
        "python-fu-clothify",
 
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",
54
62
        "1997-1999",
55
 
        "<Image>/Python-Fu/Alchemy/_Clothify",
 
63
        "_Clothify...",
56
64
        "RGB*, GRAY*",
57
65
        [
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)
63
71
        ],
64
72
        [],
65
 
        python_clothify)
 
73
        clothify, menu="<Image>/Filters/Artistic")
66
74
 
67
75
main()