Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Blur, change mode, save as
#5
Thanks Ofnuts!

But this is tough. I've been at it for hours, but I can't get the script to appear in one of the menu's, (let alone try it).

I do see it pass by in the splash-screen, so the folder where I placed the script.py is correct
Also I see a terminal screen flash by, so I think the Hello, world! is working.

From different sources I put this together:

Code:
from gimpfu import *

def plugin_main(timg, tdrawable):
    print "Hello, world!"

register(
    "tkemmere_blur",
    "Blur en 5 tinten maken en dat 5x met verschillende blur",
    "Blur en 5 tinten maken en dat 5x met verschillende blur",
    "tkemmere",
    "tkemmere",
    "21-11-2022",
    "<Image>/Filters/tkemmere blur",
    "RGB*, GRAY*",
    [],
    [],
    tkemmere_blur)

main()

for blur in [10,20,30,40]:
   outputFile="%s-%02d.png" % (rootName,blur)    # Possibly a bit more complex than this
   blurImage=image.duplicate()                    # Temporary copy
   pdb.gimp_image_undo_disable(blurImage)        # Disable undo
   layer=blurImage.activeLayer
   pdb.plug_in_gauss_iir(blurImage, layer, blur, True,True)
   pdb.gimp_drawable_posterize(layer,5)
   pdb.file_png_save_defaults(image, layer, outputFile, outputFile) # Other calls possible with more options
   gimp.delete(blurImage)                         # Throw away this copy

I'm not sure if everything is required. But this tutorial was quite explicit that it is the bare minimum.

I'm trying to make it appear in a menu, so I can start working with/on the actual script.

When I paste it in the console there are no errors, but nothing happens. Unless it is working without actually visually showing what it is doing and then saving the file in a place I'm overlooking. I don't know where rootName is. I did look in the most obvious places around my machine.

Is it normal that when a script is running you don't see anything happen?

Am I close?!  Smile  Thanks to anyone in advance!
Reply


Messages In This Thread
Blur, change mode, save as - by tkemmere - 11-21-2022, 09:50 AM
RE: Blur, change mode, save as - by Ofnuts - 11-21-2022, 11:12 AM
RE: Blur, change mode, save as - by tkemmere - 11-21-2022, 12:11 PM
RE: Blur, change mode, save as - by Ofnuts - 11-21-2022, 12:40 PM
RE: Blur, change mode, save as - by tkemmere - 11-21-2022, 10:47 PM
RE: Blur, change mode, save as - by Ofnuts - 11-21-2022, 11:42 PM
RE: Blur, change mode, save as - by rich2005 - 11-22-2022, 01:30 PM
RE: Blur, change mode, save as - by tkemmere - 11-22-2022, 10:49 PM
RE: Blur, change mode, save as - by tkemmere - 11-23-2022, 10:39 PM

Forum Jump: