![]() ![]() To call it: gimp -idf -batch-interpreter python-fu-eval -b "import sys sys.path= sys.path import batch n('./images')" -b "pdb.gimp_quit(1)" Print "Running as _main_ with args: %s" % sys.argv Print "Finished, total processing time: %.2f seconds" % (end-start) # os.mkdir(os.path.join(directory,'processed'))įor infile in glob.glob(os.path.join(directory, '*.jpg')): Print "Running on directory \"%s\"" % directory Outfile=os.path.join(os.path.dirname(infile),outfile) Outfile=os.path.join('processed',os.path.basename(infile)) Pdb.plug_in_cartoon(image, drawable, 7.,0.2) Image = pdb.gimp_file_load(infile, infile, run_mode=RUN_NONINTERACTIVE) The batch script (saved as batch.py): #!/usr/bin/python IMHO you should even avoid this, this unnecessarily pollutes Gimp's menus and procedure name space. To run a python script you don't need to have it register as a plugin. The script actually works when i run it from Gimp itself, but when i try to run it from my cmd, Gimp opens with another cmd saying: Error: ( : 1) eval: unbound variable: hello_world 'When run this plug-in prints "Hello, GIMP world!" in a dialog box.', 'A simple Python-Fu "Hello, World" plug-in', I left out the interface statement and I also tried out the most simple example to figure out whats wrong: #!/usr/bin/env python However, no matter what i do, i always geht the same error message: I try to run the script from my cmd like this: gimp-2.8 -no-interface -batch '(python_fu_hello_world RUN-NONINTERACTIVE "Hello" Arial 50 red)' -b '(gimp-quit 1)' (PF_STRING, "string", "Text string", 'Hello, world!'), "", # Create a new image, don't work on an existing one "Create a new image with your text string", # Can't add this first because we don't know the size of the text layer.īackground = gimp.Layer(img, "Background", layer.width, layer.height, Img.resize(layer.width, layer.height, 0, 0) # Resize the image to the size of the layer Layer = pdb.gimp_text_fontname(img, None, 0, 0, initstr, 10, ![]() # Create a new text layer (-1 for the layer means create a new layer) # First do a quick sanity check on the font Right now, i't trying to do that with an example script: #!/usr/bin/env pythonĭef hello_world(initstr, font, size, color) : I'm trying to use functions of gimp 2.8.22 to convert a pdf to jpeg and i want to do that with a python script using the gimpfu library from my windows cmd (i have installed python 3.6.1). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |