I can get the current images open using gimp.image_list() but how can I export them to a single pdf? The function pdb.file_pdf_multi_save() does not work. I do not intend to use ImageMagick, not sure if it still works either.
This is not properly answered in this question: Export multi page pdf with gimp
from gimpfu import *
# 1012982852
def antiquify(image, rndm_pct, rndm_rcount, randomize, seed, horizontal, vertical, low_threshold, high_threshold, spread_amount_x, spread_amount_y, filename):
pdb.gimp_undo_push_group_start(image)
for subimage in gimp.image_list():
opacity = 80.0
pdb.gimp_context_set_opacity(opacity)
drawable=subimage.active_layer
pdb.plug_in_randomize_pick(image,drawable,rndm_pct, rndm_rcount, randomize, seed)
# pdb.plug_in_spread(subimage,drawable,spread_amount_x, spread_amount_y)
# pdb.plug_in_spread(subimage,drawable,spread_amount_x, spread_amount_y)
# pdb.plug_in_gauss_rle2(subimage,drawable,horizontal, vertical)
opacity = 100.0
pdb.gimp_context_set_opacity(opacity)
pdb.gimp_threshold(drawable, low_threshold, high_threshold)
images = gimp.image_list()
# num_images, image_ids = pdb.gimp_image_list()
pdb.file_pdf_save_multi(len(images), images, False, False, False, filename, filename)
pdb.gimp_undo_push_group_end(image)
register(
"python-fu-antiquify",
"Make a LaTeX document antique",
"",
"Masum Billal",
"Masum Billal",
"2022",
"Antiquify",
"",
[
# basic parameters are: (UI_ELEMENT, "variable", "label", Default)
(PF_IMAGE, "image", "takes current image", None),
(PF_SLIDER, "rndm_pct", "Random Percent for Pick", 10, (0, 100, .5)),
(PF_SLIDER, "rndm_rcount", "Number of Iteration for Pick", 1, (0, 10, 1)),
(PF_BOOL, "randomize", "Randomize or not for Pick", True),
(PF_INT, "seed", "Seed of randomization for Pick", 1),
(PF_SLIDER, "horizontal", "Horizontal for Gaussian blur", .5, (0, 10, .5)),
(PF_SLIDER, "vertical", "Vertical for Gaussian blur", .5, (0, 10, .5)),
(PF_SLIDER, "low_threshold", "Threshold low", 200, (0, 255, 1)),
(PF_SLIDER, "high_threshold", "Threshold high", 255, (0, 255, 1)),
(PF_SLIDER, "spread_amount_x", "Horizontal spread", 2, (0, 20, 1)),
(PF_SLIDER, "spread_amount_y", "Vertical spread", 2, (0, 20, 1)),
(PF_STRING, "filename", "PDF Filename", None),
],
[],
antiquify,
menu="<Image>/Filters/Noise",
)
main()
gimp
andpython
over there is anybody's guess :)