looking for syntax example of 'gimp.Channel(image,name,width,height,opacity,color)'

44 Views Asked by At

No problems with 'pdb.gimp_channel_new(image, width, height, name, opacity, color)'
but I cannot get the syntax for 'gimp.Channel(image,name,width,height,opacity,color)'

>>> image=gimp.image_list()[0]
>>> channel = pdb.gimp_channel_new(image,800,600,'name',50,(0,0,0))
>>> ch=gimp.Channel(image,'name',800,600,50,(0,0,0))
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: type mismatch
>>> 

thanks!

1

There are 1 best solutions below

2
On BEST ANSWER

The color should be a real RGB color object:

import gimpcolor
ch=gimp.Channel(image,'name',800,600,50,gimpcolor.RGB(0,0,0))