Kevin York
Kevin York

Reputation: 13

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

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!

Upvotes: 0

Views: 42

Answers (1)

xenoid
xenoid

Reputation: 8914

The color should be a real RGB color object:

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

Upvotes: 1

Related Questions