Search code examples
pythongimppython-fu

Error when calling gimp-drawable-set-pixel in gimp's python console


I'm typing this code directly into Gimp's Python Console:

img=gimp.image_list()[0]
drw = pdb.gimp_image_active_drawable(img)
gimp-drawable-set-pixel(drw,x,y,3,[0xff,0x00,0x00])

and it's yeilding this error after calling the gimp-drawable-set-pixel function:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'drawable' is not defined

It yields the same error when called with four bytes instead of three bytes as well.

I'm using gimp 2.8.10 on Ubuntu 14.04.01 x86_64


Solution

  • I think it's a typo of gimp_drawable_set_pixel.

    pdb.gimp_drawable_set_pixel(drw,x,y,3,[0xff,0x00,0x00])