Exemple #1
0
        (gimpfu.PF_FLOAT, "clip_percent_black", "Black clip percentage", 0.0),
        (gimpfu.PF_FLOAT, "clip_percent_white", "White clip percentage", 0.0)
    ],
    results=[(gimpfu.PF_INT, "black_point", "Black point"),
             (gimpfu.PF_INT, "white_point", "White point")],
    function=get_color_clip)

gimpfu.register(
    proc_name="color_clip",
    blurb=
    ("Darken/brighten a given percentage of the darkest/brightest pixels in the "
     "drawable"),
    help="The drawable can be a layer, layer mask or a channel.\n" +
    _plugin_help,
    author="khalim19",
    copyright="khalim19",
    date="2015",
    label="<Image>/Colors/Color Clip...",
    imagetypes="RGB*, GRAY*",
    params=[(gimpfu.PF_SLIDER, "clip_percent_black", "Black clip percentage",
             0.0, (0.0, 100.0, 0.1)),
            (gimpfu.PF_SLIDER, "clip_percent_white", "White clip percentage",
             0.0, (0.0, 100.0, 0.1))],
    results=[],
    function=color_clip)

#===============================================================================

if __name__ == "__main__":
    gimpfu.main()
Exemple #2
0
    "Spine export",
    # help
    "Exports layers to images and outputs a Spine JSON file",
    # author
    "Carlo Cabanilla",
    # copyright
    "Carlo Cabanilla",
    # date
    "2014",
    # menupath
    "<Image>/File/Export/Export to Spine",
    # imagetypes
    "*",
    # params
    [   
        (gimpfu.PF_ADJUSTMENT, "compression", "PNG Compression level:", 0, (0, 9, 1)),
        (gimpfu.PF_DIRNAME, "dir", "Directory", "/tmp"),
        (gimpfu.PF_STRING, "json_filename", "JSON filename", ""),
        (gimpfu.PF_TOGGLE,   "export_visible_only", "Export visible layers only", True),
        (gimpfu.PF_TOGGLE,   "reverse_draw_order", "Reverse draw order", False),
        (gimpfu.PF_TOGGLE,   "autocrop_layers", "Autocrop layers", False),
        (gimpfu.PF_ADJUSTMENT, "padding_amt", "Padding pixels", 0, (0,100,1))
    ],
    # results
    [],
    # function
    spine_export
)

gimpfu.main()
Exemple #3
0
        # or you can spell it PF_COLOUR
        (PF_IMAGE, "image", "Input image", None),
        (PF_LAYER, "layer", "Input layer", None),
        (PF_CHANNEL, "channel", "Which channel", None),
        (PF_DRAWABLE, "drawable", "Input drawable", None),
        (PF_TOGGLE, "shadow", "Shadow?", 1),
        (PF_BOOL, "ascending", "_Ascending", True),
        (PF_RADIO, "imagefmt", "Image format", "jpg", (("png", "png"),
                                                       ("jpg", "jpg"))),
        (PF_OPTION, "option", "Option", 2, ("Mouse", "Cat", "Dog", "Horse")),
        (PF_SPINNER, "size", "Pixel Size", 50, (1, 8000, 1)),
        (PF_SLIDER, "opacity", "Op_acity", 100, (0, 100, 1)),
        # (PF_ADJUSTMENT is the same as PF_SPINNER
        (PF_FILE, "imagefile", "Image file", ""),
        (PF_DIRNAME, "dire", "Directory", "/tmp"),
        (PF_FONT, "font", "Font", "Sans"),
        (PF_BRUSH, "brush", "Brush", None),
        (PF_PATTERN, "pattern", "Pattern", None),
        (PF_GRADIENT, "gradient", "Gradient", None),
        (PF_PALETTE, "palette", "Palette", ""),

        # New items that don't quite work yet:
        #(PF_VECTORS, "vectors", "Vectors", None),
        #(PF_DISPLAY, "display", "Display", None),
    ],
    [],
    show_py_ui,
    menu="<Image>/Filters/Languages/Python-Fu")

main()
Exemple #4
0
    "python_fu_gravilens_warp",
    "Gravitational Lens Warp",
    "Create gravitational lens effect over selected region.",
    "Andrey Zamaraev",
    "MIT License",
    "2018",
    "<Image>/Filters/Distorts/Gravitational Lens Warp",
    "GRAY*, RGB*",
    [
        (
            fu.PF_SLIDER,
            "inner_radius_percent", "Inner Radius, %",
            50, (0, 100, 0.1)
        ),
        (
            fu.PF_SLIDER,
            "outer_radius_percent", "Outer Radius, %",
            100, (0, 100, 0.1)
        ),
        (
            fu.PF_BOOL,
            "inside", "Render inside inner radius",
            False
        ),
    ],
    [],
    gravilens_warp
)

fu.main()
Exemple #5
0
class DepthEstimation(GimpPluginBase):
    model_options = [
        ("MiDaS (778 MB)", "MiDaS.py"),
        ("Monodepth2 (112 MB)", "Monodepth2.py"),
    ]

    def run(self, model_idx, apply_colormap):
        display_name, self.model_file = self.model_options[model_idx]
        colormap = "magma" if apply_colormap else None
        result = self.predict(self.drawable, colormap)
        layer_name = self.drawable.name + " " + display_name.split()[0]
        self.create_layer(result, name=layer_name)


plugin = DepthEstimation()
plugin.register(proc_name="depth_estimation",
                blurb="Monocular depth estimation",
                help="Generate an inverse depth map based on deep learning.",
                author="Martin Valgur",
                copyright="",
                date="2020",
                label="Depth Estimation...",
                imagetypes="RGB*",
                params=[
                    (gfu.PF_OPTION, "Model", "Model", 0,
                     [x[0] for x in DepthEstimation.model_options]),
                    (gfu.PF_TOGGLE, "Colormap", "Apply colormap", 0, True),
                ])
gfu.main()
Exemple #6
0
        yield "(disabled)", None
        for port, desc, _ in comports():
            yield '{0} ({1})'.format(port, desc.strip()), port


register(
        "pysstv_for_gimp",
        "PySSTV for GIMP",
        "Transmits the current image using PySSTV",
        "Andras Veres-Szentkiralyi",
        "Andras Veres-Szentkiralyi",
        "November 2013",
        "<Image>/PySSTV/Transmit...",
        "*",
        [
            (PF_RADIO, "mode", "SSTV mode", "MartinM1",
                tuple((n, n) for n in sorted(MODULE_MAP.iterkeys()))),
            (PF_BOOL, "vox", "Include VOX tones", True),
            (PF_STRING, "fskid", "FSK ID", ""),
            (PF_RADIO, "ptt_port", "PTT port", None,
                tuple(get_serial_ports())),
            (PF_RADIO, "ptt_pin", "PTT pin", "RTS",
                tuple((n, n) for n in ("RTS", "DTR"))),
            (PF_BOOL, "ptt_state", "PTT inversion", False),
        ],
        [],
        transmit_current_image
        )

main()
Exemple #7
0
            isLayer = True
            mod_gimpfu.pdb.gimp_file_save(image, lr, name, name)

    if isLayer == False:
        name = basePath + ".bmp"
        mod_gimpfu.pdb.gimp_file_save(image, layer, name, name)

    path = mod_gimpfu.pdb.gimp_image_get_filename(image)
    path = os.path.dirname(path)
    oldpath = ""
    while path != None and path != "" and path != oldpath:
        if os.path.exists(path + "/ThisIsRoot") == True:
            #mod_gimpfu.pdb.gimp_message(path)
            fd = os.open(path + "/texexp.par",
                         os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
            locPath = basePath[len(path) + 9:]
            os.write(fd, locPath)
            os.close(fd)
            os.system(path + "/texexp.exe")
            break
        oldpath = path
        path = os.path.dirname(path)


mod_gimpfu.register("texture_export", "Export To Textures",
                    "Export To Textures", "Shutov N.V.", "Shutov N.V.", "2013",
                    "<Image>/Lake/_Save Textures", "RGB*, GRAY*", [], [],
                    save_layers)

mod_gimpfu.main()
Exemple #8
0
    print "Instantiating server..."
    remote_gimp = Pyro3Server()

    # Bypass NS
    # proxy = Pyro.core.getProxyForURI('PYROLOC://hostname:port/objectname')
    print "Pyro.core.initServer()..."
    Pyro.core.initServer()
    print "Instantiating daemon..."
    daemon = Pyro.core.Daemon(host="localhost", port=16319)
    daemon.connect(remote_gimp, 'remote_gimp')
    print "Entering loop..."
    daemon.requestLoop()

# This is the plugin registration function
# I have written each of its parameters on a different line
register(# @UndefinedVariable
    "pyro2gimp",
    "Launches a PyRO server",
    "Launches a PyRO (Python Remote Objects) server to access Gimp internals",
    "Horacio G. de Oro",
    "Horacio G. de Oro",
    "December 2013",
    "<Image>/Filters/Python-Fu/PyRO Server",
    "*",
    [],
    [],
    start_pyro3_server,
    )

main()  # @UndefinedVariable