gimpscript-fugimpfupython-fu

What does the 'gimp_histogram' procedure require to work?


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:

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


Solution

  • 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})