It is currently Sat Jun 29, 2024 11:13 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: como activar de capa con python-fu ?
PostPosted: Fri Mar 12, 2021 7:00 pm  (#1) 
Offline
New Member

Joined: Mar 12, 2021
Posts: 2
:gaah AYUDA

Estoy tratando de automatizar las acciones para hacer las piezas de un rompecabezas con la utilización de puzzle de Gimp, es una tarea repetitiva por lo cual me aventure por primera vez a utilizar la opción de la consola de Python.

Los pasos que seguir (son los que deseo automatizar), son relativamente sencillos, insertar una capa a la imagen original, en esta capa inserta la plantilla del puzzle, seleccionar activar la imagen, copiar visible y pegar en una nueva capa para conseguir la pieza.

En la consola de Python y utilizando el examinador de procedimientos de Python he comprobado la utilización y aplicación de los procedimientos con cierto éxito, pues estoy atorado en la activación de la imagen o de las capas. Esto se puede logra con:

Trate de utilizar
pdb.gimp_image_set_active_layer(image, active_layer)
sin éxito no se que parámetro recibe active_layer; si pongo el nombre de la capa o el número de posición indica error wrong parameter type

al igual quise obtener la posición de la capa con
position = pdb.gimp_image_get_item_position(image, item)
sin éxito no se que parámetro va en item

Si alguien puede explicarme si se requiere alguna definición anterior al procedimiento?
Y cuales son los parámetros o valores y como obtenerlos

Gracias por su atención


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: como activar de capa con python-fu ?
PostPosted: Fri Mar 12, 2021 9:37 pm  (#2) 
Offline
GimpChat Member

Joined: May 12, 2015
Posts: 4694
Serio, i ,copied your post and put it in a translator to see if I could help, but I don't think I can. There are some here who can, and may or not speak Spanish.
Please post in English in this forum.

Welcome to Gimp
________________________________________________________________

: gaah HELP

I am trying to automate the actions to make the pieces of a puzzle with the use of Gimp's puzzle, it is a repetitive task so I ventured for the first time to use the Python console option.

The steps to follow (they are the ones I want to automate), are relatively simple, insert a layer to the original image, in this layer insert the puzzle template, select activate the image, copy visible and paste in a new layer to get the piece .

In the Python console and using the Python procedure browser I have verified the use and application of the procedures with some success, as I am stuck in activating the image or the layers. This can be accomplished with:

Try to use
pdb.gimp_image_set_active_layer (image, active_layer)
without success I don't know what parameter active_layer receives; if I put the name of the layer or the position number it indicates error wrong parameter type

like I wanted to get the position of the layer with
position = pdb.gimp_image_get_item_position (image, item)
without success I don't know what parameter goes in item

If someone can explain to me if any definition is required prior to the procedure?
And what are the parameters or values ​​and how to obtain them

Thanks for your attention


Top
 Post subject: Re: como activar de capa con python-fu ?
PostPosted: Sat Mar 13, 2021 12:43 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12705
Location: Spain, Aragón
Bienvenido serio a Gimp Chat. Has venido al foro mejor para aprender y disfrutar Gimp.
He leido tu intención de hacer un puzle, en realidad piezas de un puzle. Esto es algo que no he hecho nunca, pero quiero ayudarte si puedo.
¿Podrías indicarme dónde está la opción para crearlo? En tener los datos te podré escribir un tutorial para que lo sigas más facilmente.
Aquí en este foro, nos comunicamos en inglés mejor, pues sabes que es una lengua internacional y hay muchísimos expertos y tan preparados con ganas de ayudar que creo que entre todos podremos ayudarte.
Hasta pronto,
Un saludo
Issa

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.


Top
 Post subject: Re: como activar de capa con python-fu ?
PostPosted: Sat Mar 13, 2021 3:36 am  (#4) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 7742
Location: On the other side of this screen
Please keep your posts in English. Serio if you don't know how to speak English get them translated in Google translate or something similar
Mantenga sus publicaciones en inglés. Serio, si no sabes hablar inglés, haz que se traduzcan en el traductor de Google o algo similar.
https://translate.google.com/

Thank you Pat but you shouldn't have to do that and thank you Issabella but try to encourage people to speak in English as you do, in future please.

_________________


Top
 Post subject: Re: como activar de capa con python-fu ?
PostPosted: Sat Mar 13, 2021 10:57 am  (#5) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
Has tratado este modo: gimp.image_list()
Have you tried this way: gimp.image_list()

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


Top
 Post subject: Re: como activar de capa con python-fu ?
PostPosted: Sat Mar 13, 2021 1:49 pm  (#6) 
Offline
New Member

Joined: Mar 12, 2021
Posts: 2
Issabella
The puzzle option is in:
Filters -> Rendered -> Pattern -> Puzzle
Puzzle gives you the options of number of pieces, beveled edges and style,
It is applied to the image and the pieces are seen

Sallyanne
I will translate my publications

Pocholo
I'm going to try your suggestion and then comment what happened

Pat625
Thanks

Thank you all for your interest


Top
 Post subject: Re: como activar de capa con python-fu ?
PostPosted: Sat Mar 13, 2021 4:50 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12705
Location: Spain, Aragón
Serio, I wrote how I would do the process. Hopefully, it can help you.
If you need more explanation, please let us know. :)


Attachments:
How I see the procedure for jigsaw.pdf [358.68 KiB]
Downloaded 74 times

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: como activar de capa con python-fu ?
PostPosted: Sun Mar 14, 2021 9:02 am  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4752
Pat625 wrote:
Serio, i ,copied your post and put it in a translator to see if I could help, but I don't think I can. There are some here who can, and may or not speak Spanish.
Please post in English in this forum.

Welcome to Gimp
________________________________________________________________

: gaah HELP

I am trying to automate the actions to make the pieces of a puzzle with the use of Gimp's puzzle, it is a repetitive task so I ventured for the first time to use the Python console option.

The steps to follow (they are the ones I want to automate), are relatively simple, insert a layer to the original image, in this layer insert the puzzle template, select activate the image, copy visible and paste in a new layer to get the piece .

In the Python console and using the Python procedure browser I have verified the use and application of the procedures with some success, as I am stuck in activating the image or the layers. This can be accomplished with:

Try to use
pdb.gimp_image_set_active_layer (image, active_layer)
without success I don't know what parameter active_layer receives; if I put the name of the layer or the position number it indicates error wrong parameter type

like I wanted to get the position of the layer with
position = pdb.gimp_image_get_item_position (image, item)
without success I don't know what parameter goes in item

If someone can explain to me if any definition is required prior to the procedure?
And what are the parameters or values ​​and how to obtain them

Thanks for your attention


In the Python API, a layer parameter is a gimp.Layer. You get one when you create/obtain the layer, as the return value of the function you called (pdb.gimp_layer_new(), pdb.gimp_image_get_active_layer() or others).

One thing to keep in mind is that the Python PDB documentation is generated automatically from descriptions that are also used for script-fu, while these API work a bit differently. Script-fu identifies everything by a unique ID while the Python API handles "facade" objects. So where the doc says to use an id, you can pass an object in Python, and when it says you get an ID, you get an object of the adequate class. Wen unknown (as a parameter or as a return result, script-fu uses 0, and python uses None.

Plenty of python script examples here.

_________________
Image


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Convert GIMP plugin from Python 2 to Python 3

4

No new posts Difference between "Python-Fu" and "Python" plugin

6

No new posts Attachment(s) How to add Python-FU to gimp

17

No new posts Help with pdb.plug_in_displace when using python-fu in OS X

1

No new posts Attachment(s) Help with pdb.plug_in_displace when using python-fu

4



* Login  



Powered by phpBB3 © phpBB Group