What does the 'gimp_histogram' procedure require to work?

121 views Asked by At

I do not understand why my call to pdb.gimp_histogram throws a RuntimeError: execution error.

from gimpfu import *

def plugin_main ( timg, tdrawable ):

    pdb.gimp_histogram( tdrawable, 0, 0, 255 )

According to the docs, the function takes four arguments:

  • drawable ( type drawable)
  • channel to modify ( type int )
  • start range ( type int )
  • end range ( type int)

I provide all four in the barebones code above, so why is the error thrown?

1

There are 1 answers

2
xenoid On BEST ANSWER

The code looks correct (I have similar code that works).

However I get the same error if the image is color-indexed, while the doc says "The drawable may not be indexed.", so that could be your problem?

PS: You should use the named constants (HISTOGRAM_{VALUE|RED|BLUE|GREEN|ALPHA})