Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble replicating posterize with blending option enabled in python-fu script
#1
Python 
Hello! I've recently started scripting with gimp and I've ran into a problem with posterize. I believe the issue is with how I am trying to implement the blending option. Does anyone have experience with automating the posturize tool with a blending option enabled?

I've found:
gimp_edit_blend()
gimp_context_set_paint_mode()
gimp_layer_set_mode()

Removed Alpha layer, manually using the posterize tool with 2 levels an color erase blending
[Image: asdf.png]
With my tool set to 2 levels using gimp_edit_blend
[Image: qwer.png]

Code:
srclayer = image.layers[0]
pdb.gimp_image_insert_layer(image, pdb.gimp_layer_copy(srclayer, 0), None, -1)
pdb.gimp_drawable_posterize(image.layers[0], amount)
pdb.gimp_context_set_paint_mode(57)
image.layers[0] = blendColorErase(image.layers[0])

It's quite possible I'm completely missing how the posterize tool accomplishes the blending. So far the results I've been getting are as if I had no blending mode selected (Replace/Normal). I'm aiming to use the Color Erase paint mode, but I'm running out of ideas what I'm doing wrong.

Thank you for reading.
Reply


Messages In This Thread
Trouble replicating posterize with blending option enabled in python-fu script - by Error - 06-16-2022, 07:29 PM

Forum Jump: