fork download
  1. from gimpfu import *
  2.  
  3. # 1012982852
  4.  
  5. def antiquify(image, rndm_pct, rndm_rcount, randomize, seed, horizontal, vertical, low_threshold, high_threshold, spread_amount_x, spread_amount_y, filename):
  6. pdb.gimp_undo_push_group_start(image)
  7. for subimage in gimp.image_list():
  8. opacity = 80.0
  9. pdb.gimp_context_set_opacity(opacity)
  10. drawable=subimage.active_layer
  11. pdb.plug_in_randomize_pick(image,drawable,rndm_pct, rndm_rcount, randomize, seed)
  12. # pdb.plug_in_spread(subimage,drawable,spread_amount_x, spread_amount_y)
  13. # pdb.plug_in_spread(subimage,drawable,spread_amount_x, spread_amount_y)
  14. # pdb.plug_in_gauss_rle2(subimage,drawable,horizontal, vertical)
  15. opacity = 100.0
  16. pdb.gimp_context_set_opacity(opacity)
  17. pdb.gimp_threshold(drawable, low_threshold, high_threshold)
  18. images = gimp.image_list()
  19. # num_images, image_ids = pdb.gimp_image_list()
  20. pdb.file_pdf_save_multi(len(images), images, False, False, False, filename, filename)
  21. pdb.gimp_undo_push_group_end(image)
  22.  
  23. register(
  24. "python-fu-antiquify",
  25. "Make a LaTeX document antique",
  26. "",
  27. "Masum Billal",
  28. "Masum Billal",
  29. "2022",
  30. "Antiquify",
  31. "",
  32. [
  33. # basic parameters are: (UI_ELEMENT, "variable", "label", Default)
  34. (PF_IMAGE, "image", "takes current image", None),
  35. (PF_SLIDER, "rndm_pct", "Random Percent for Pick", 10, (0, 100, .5)),
  36. (PF_SLIDER, "rndm_rcount", "Number of Iteration for Pick", 1, (0, 10, 1)),
  37. (PF_BOOL, "randomize", "Randomize or not for Pick", True),
  38. (PF_INT, "seed", "Seed of randomization for Pick", 1),
  39. (PF_SLIDER, "horizontal", "Horizontal for Gaussian blur", .5, (0, 10, .5)),
  40. (PF_SLIDER, "vertical", "Vertical for Gaussian blur", .5, (0, 10, .5)),
  41. (PF_SLIDER, "low_threshold", "Threshold low", 200, (0, 255, 1)),
  42. (PF_SLIDER, "high_threshold", "Threshold high", 255, (0, 255, 1)),
  43. (PF_SLIDER, "spread_amount_x", "Horizontal spread", 2, (0, 20, 1)),
  44. (PF_SLIDER, "spread_amount_y", "Vertical spread", 2, (0, 20, 1)),
  45. (PF_STRING, "filename", "PDF Filename", None),
  46. ],
  47. [],
  48. antiquify,
  49. menu="<Image>/Filters/Noise",
  50. )
  51.  
  52. main()
Runtime error #stdin #stdout #stderr 0.15s 23376KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ModuleNotFoundError: No module named 'gimpfu'