It is currently Sat Jun 29, 2024 1:32 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: wrong parameter type in pdb.plug_in_cubism
PostPosted: Wed May 06, 2020 9:43 am  (#1) 
Offline
GimpChat Member

Joined: Apr 09, 2020
Posts: 9
Hi there,

I seem to have a pretty strange problem: a line of code
pdb.plug_in_cubism(layer, drawable, 20.5, 5.5, 0)

produces an error message which reads
Quote:
wrong parameter type
.

he function from the Py-console is
pdb.plug_in_cubism(image, drawable, tile_size, tile_saturation, bg_color)
with tile_size - float, tile_saturation - float, bg_color - int32.

And I plain don't understand what am I doing wrong. Could you please help me with ideas? :bump


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Wed May 06, 2020 10:43 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Hi RockLizard
pdb.plug_in_cubism(layer,image, drawable, 20.5, 5.5, 0)

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Thu May 07, 2020 11:05 am  (#3) 
Offline
GimpChat Member

Joined: Apr 09, 2020
Posts: 9
Ow, thanks a million. This works. But somehow it affects only a layer. This is why I got confused in the first place... Should go and learn more about image and layer concepts...

MareroQ wrote:
Hi RockLizard
pdb.plug_in_cubism(layer,image, drawable, 20.5, 5.5, 0)


Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Thu May 07, 2020 5:46 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4751
RockLizard wrote:
Ow, thanks a million. This works. But somehow it affects only a layer. This is why I got confused in the first place... Should go and learn more about image and layer concepts...

MareroQ wrote:
Hi RockLizard
pdb.plug_in_cubism(layer,image, drawable, 20.5, 5.5, 0)


Most things you do "by hand" in Gimp only affect a layer and not the whole image.....

_________________
Image


Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Sat May 09, 2020 10:26 am  (#5) 
Offline
GimpChat Member

Joined: Apr 09, 2020
Posts: 9
ofnuts wrote:
Most things you do "by hand" in Gimp only affect a layer and not the whole image.....


I am lost again. Is there a way to apply "manual" operation to every layer/batch of files, except external script calling GIMP for every image? I tried changing layers order and assigning new active layer and it did not work(


Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Sat May 09, 2020 11:46 am  (#6) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
If you have Windows OS, have you tried "BIMP"? it integrate with GIMP.
https://alessandrofrancesconi.it/projects/bimp/

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Sat May 09, 2020 1:01 pm  (#7) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2435
RockLizard wrote:
I am lost again. Is there a way to apply "manual" operation to every layer/batch of files, except external script calling GIMP for every image? I tried changing layers order and assigning new active layer and it did not work(


BIMP works very well for individual images, use "other gimp procedure"

For a single image and a stack of layers, this a skeleton for you to improve on.

#!/usr/bin/env python
from gimpfu import *

def testing (layer, drawable ):

    image = gimp.image_list()[0]
    for layer in image.layers:
        pdb.plug_in_cubism(image, layer, 20.5, 5.5, 0)

register(
   "python_fu_testing",
   " ",
   " ",
   "",
   " ",
   "2020",
   "<Image>/Tools/testing",
   "*",
   [],
   [],
   testing,
         )
main()


...and do not ask me, I am no coder ;)

_________________
Image


Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Sat May 09, 2020 3:19 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4751
rich2005 wrote:
RockLizard wrote:
I am lost again. Is there a way to apply "manual" operation to every layer/batch of files, except external script calling GIMP for every image? I tried changing layers order and assigning new active layer and it did not work(


BIMP works very well for individual images, use "other gimp procedure"

For a single image and a stack of layers, this a skeleton for you to improve on.

#!/usr/bin/env python
from gimpfu import *

def testing (layer, drawable ):

    image = gimp.image_list()[0]
    for layer in image.layers:
        pdb.plug_in_cubism(image, layer, 20.5, 5.5, 0)

register(
   "python_fu_testing",
   " ",
   " ",
   "",
   " ",
   "2020",
   "<Image>/Tools/testing",
   "*",
   [],
   [],
   testing,
         )
main()


...and do not ask me, I am no coder ;)


Good try, but "image = gimp.image_list()[0]" retrieves one image among the ones that are open, and that may not be the active one, so as written the script is quite dangerous... In fact the first argument of your function (the one you call "layer") is the image you are working on and not a layer, so you code could start with:

#!/usr/bin/env python
from gimpfu import *

def testing (image, drawable ):

    for layer in image.layers:
        pdb.plug_in_cubism(image, layer, 20.5, 5.5, 0)

_________________
Image


Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Sun May 10, 2020 3:14 am  (#9) 
Offline
GimpChat Member

Joined: Apr 09, 2020
Posts: 9
:tyspin will remember it, as I am not a codes as well, and I am also nearly 0 in GIMP particularities.
rich2005 wrote:
RockLizard wrote:
I am lost again. Is there a way to apply "manual" operation to every layer/batch of files, except external script calling GIMP for every image? I tried changing layers order and assigning new active layer and it did not work(


BIMP works very well for individual images, use "other gimp procedure"

For a single image and a stack of layers, this a skeleton for you to improve on.

#!/usr/bin/env python
from gimpfu import *

def testing (layer, drawable ):

    image = gimp.image_list()[0]
    for layer in image.layers:
        pdb.plug_in_cubism(image, layer, 20.5, 5.5, 0)

register(
   "python_fu_testing",
   " ",
   " ",
   "",
   " ",
   "2020",
   "<Image>/Tools/testing",
   "*",
   [],
   [],
   testing,
         )
main()


...and do not ask me, I am no coder ;)


Last edited by RockLizard on Sun May 10, 2020 3:27 am, edited 1 time in total.

Top
 Post subject: Re: wrong parameter type in pdb.plug_in_cubism
PostPosted: Sun May 10, 2020 3:15 am  (#10) 
Offline
GimpChat Member

Joined: Apr 09, 2020
Posts: 9
Pocholo wrote:
If you have Windows OS, have you tried "BIMP"? it integrate with GIMP.
https://alessandrofrancesconi.it/projects/bimp/


Works perfect for the task (with some corrections). Thank you!


Top
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Python-fu gimp_drawable_levels(): "TypeError: wrong parameter type"

2

No new posts "Wrong parameter type" using Map object (Solved)

7

No new posts Script-fu skip run-mode parameter (solved)

6

No new posts Invalid parameter name dialog status error

4

No new posts Attachment(s) Don't work procedures plug-in-bump-map, plug-in-displace

2



* Login  



Powered by phpBB3 © phpBB Group