It is currently Fri Jun 28, 2024 9:17 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to pass textvariable to GMIC from python [solved]
PostPosted: Thu Dec 30, 2021 5:20 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
Hi all,

In a python script for GIMP 2.10 I try to implement the possibility to add a GMIC watermark.
This would be the line to use:
pdb.plug_in_gmic_qt(image,layer,1,1,"fx_watermark_visible watermarktext,0.1568,50,25,0.5,1")

How do I pass "watermarktext" as a variable to this GMIC call?

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Last edited by nelo on Thu Dec 30, 2021 9:37 am, edited 1 time in total.

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: How to pass textvariable to GMIC from python
PostPosted: Thu Dec 30, 2021 6:36 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2019
Posts: 136
Location: Lake Havasu City, Arizona, USA
Hi nelo,
I'm don't know the syntax for GMIC calls, but shouldn't there be a comma between the parameters?
pdb.plug_in_gmic_qt(image,layer,1,1,"fx_watermark_visible,watermarktext,0.1568,50,25,0.5,1")

_________________
Charles


Top
 Post subject: Re: How to pass textvariable to GMIC from python
PostPosted: Thu Dec 30, 2021 8:42 am  (#3) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2435
It should go like this:

pdb.plug_in_gmic_qt (image, drawable, 1, 0,   'fx_watermark_visible "Nelos Files",0.4,50,25,0.5,1')


Note the nested quotes ' ' around the " "

Attached my testing script. Find it in the tools menu - run gmic


Attachments:
for_gmic.zip [476 Bytes]
Downloaded 41 times

_________________
Image
Top
 Post subject: Re: How to pass textvariable to GMIC from python
PostPosted: Thu Dec 30, 2021 9:37 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
Thanks Rich,
That's what I already had and it only took the "hardcoded" text.
But I wanted it to be a variable, so the user can input what watermarktext they want.
Sorry if it wasn't clear enough.

Ok long story short.
I finally found this solution:
pdb.plug_in_gmic_qt(image,layer,1,0,"fx_watermark_visible {0},0.1568,50,25,0.5,1".format(watermarktext))

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Please make a python plugin to combine my GEGL filters with GMIC

1

No new posts Attachment(s) GEGL Sharpen Plugin with many high pass algorithms

0

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) Help with pdb.plug_in_displace when using python-fu

4



* Login  



Powered by phpBB3 © phpBB Group