Re: [Gimp-user] Python script

2018-06-21 Thread Alexander V. Kalachev via gimp-user-list
Thank you for your hint.

Alexander

On Thu, 21 Jun 2018 11:17:28 +0100
kevin payne  wrote:

> On 21 June 2018 at 10:32, Alexander V. Kalachev via gimp-user-list
>  wrote:
> > Dear list members,
> >
> > I wrote a script that adds an outline to the text. The script works as I 
> > expected with on exception. When it finished, it removes all textual 
> > information and converts the text into graphics. Could anyone give me an 
> > advice how to modify the script in order to keep the textual information 
> > unchanged? The script itself below.
> 
> 
> 
> You are stroking the path onto the Text layer, which will convert it
> from text to raster. To keep the Test layer you will need to stroke
> the path onto a new layer.
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Python script

2018-06-21 Thread Alexander V. Kalachev via gimp-user-list
Thank you for your explanation.

Alexander

On Thu, 21 Jun 2018 08:46:32 -0400
Carol Spears  wrote:

> On Thu, Jun 21, 2018 at 5:32 AM, Alexander V. Kalachev via gimp-user-list <
> gimp-user-list@gnome.org> wrote:
> 
> > Dear list members,
> >
> > I wrote a script that adds an outline to the text. The script works as I
> > expected with on exception. When it finished, it removes all textual
> > information and converts the text into graphics. Could anyone give me an
> > advice how to modify the script in order to keep the textual information
> > unchanged? The script itself below.
> >
> >
> The layer will fail to be a text layer after being changed by any tool or
> plug-in which is not the text tool.  The text becomes just another painted
> layer.
> 
> Perhaps a different software will retain the textural information, but not
> GIMP.
> 
> carol
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Python script

2018-06-21 Thread kevin payne via gimp-user-list
On 21 June 2018 at 10:32, Alexander V. Kalachev via gimp-user-list
 wrote:
> Dear list members,
>
> I wrote a script that adds an outline to the text. The script works as I 
> expected with on exception. When it finished, it removes all textual 
> information and converts the text into graphics. Could anyone give me an 
> advice how to modify the script in order to keep the textual information 
> unchanged? The script itself below.



You are stroking the path onto the Text layer, which will convert it
from text to raster. To keep the Test layer you will need to stroke
the path onto a new layer.
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Python script

2018-06-21 Thread Carol Spears via gimp-user-list
On Thu, Jun 21, 2018 at 5:32 AM, Alexander V. Kalachev via gimp-user-list <
gimp-user-list@gnome.org> wrote:

> Dear list members,
>
> I wrote a script that adds an outline to the text. The script works as I
> expected with on exception. When it finished, it removes all textual
> information and converts the text into graphics. Could anyone give me an
> advice how to modify the script in order to keep the textual information
> unchanged? The script itself below.
>
>
The layer will fail to be a text layer after being changed by any tool or
plug-in which is not the text tool.  The text becomes just another painted
layer.

Perhaps a different software will retain the textural information, but not
GIMP.

carol
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Python script query

2012-11-12 Thread Chris Mohler
On Sun, Nov 11, 2012 at 7:13 PM, Lorgach  wrote:
> Thanks a lot for the sugestions guys, I'll probably keep pluging away at 
> trying
> to get some working code as time permits as I'm interested in learning Python.

With one image open, try:

Filters->Python-Fu->Console

Enter:

my_img = gimp.image_list()[0]

Then:

dir(my_img)

Also:

dir(gimp)


I usually have the console open before or during writing a plug-in so
I can mess around first.  The other window I have open is
Help->Procedure Browser.

HTH,
Chris
___
gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list


Re: [Gimp-user] Python script query

2012-11-11 Thread Ofnuts

On 11/12/2012 02:13 AM, Lorgach wrote:

Thanks a lot for the sugestions guys, I'll probably keep pluging away at trying
to get some working code as time permits as I'm interested in learning Python.
I was hoping that I'd be able to easily modify some script so that I could maybe
build two working plug-ins that would speed up the editing of Gifs for me.
Ofnuts ... I use your 'Mirror Layers' plug-in and find it a great help. It was
this script that I was hoping to be able to modify so that I could build both a
'Delete Every 2nd Layer' and also a 'Delete All Layers from a specific one'
plug-ins which would give me a nice editing suite along with the 'Mirror Layers'
for editing Gifs that are processed from videos as there's usually a lot more
frames downloaded than are necessary.


Contact me directly (I'm on Gimforums/Gimptalk/Gimpchat) if you need 
help adapting my scripts (or explain me more in detail what you need).


___
gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list


Re: [Gimp-user] Python script query

2012-11-09 Thread Jernej Simončič
On Fri, 9 Nov 2012 15:15:45 -0600, Chris Mohler wrote:

> Start GIMP in a command terminal to catch start-up errors.

That doesn't work on Windows, but modifying the shortcut to pass --verbose
to gimp-2.8.exe will bring up a console.

-- 
< Jernej Simončič ><><><><>< http://eternallybored.org/ >

___
gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list


Re: [Gimp-user] Python script query

2012-11-09 Thread Ofnuts

On 11/09/2012 08:56 PM, Lorgach wrote:

Hi,

I’m trying to introduce myself to programming in Python for Gimp, however I’m 
having difficulty in trying to run some scripts and I’m hoping that some of the 
more knowledgeable members on the Forum will be able to give me some assistance.

In order to cut down on time, and also to gain experience I decided to modify 
some of the scripts that were written by experienced Python programmers to see 
what effects I could produce on various images.
However, I have found that when I make even minor changes to a script and save 
the changed script to the ‘plug-ins’ folder under a new name, it will not show 
up in the Gimp Drop Down Menu specified in the script.
I would like to know if anyone else has come across this snag and, if so, what 
is the cause or if there is a solution.
Is there some kind of compiled code associated with a Python script when it has 
been saved under a ‘Name.py’ or when it has been run in Gimp that prevents it 
from being capable of being changed or edited.

I am using Gimp 2.8, Windows XP and the Komodo editor to make the changes.

Any help would be appreciated.



Python is very picky about indentation (tabs are not equivalent to 
spaces) so editing of working code by newcomers usually elicits syntax 
errors, and these errors make the plugin registration fail. They can be 
displayed using gimp-console but there is an even faster way: in a 
commant prompt, outside of Gimp, execute:


python the_plugin.py

The worst syntax errors will be displayed then. If you go as far as getting:

from gimpfu import *
ImportError: No module named gimpfu

then the syntax is somewhat correct and you can expect the script to run 
enough to register.




___
gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list


Re: [Gimp-user] Python script query

2012-11-09 Thread Chris Mohler
On Fri, Nov 9, 2012 at 1:56 PM, Lorgach  wrote:
> In order to cut down on time, and also to gain experience I decided to modify 
> some of the scripts that were written by experienced Python programmers to 
> see what effects I could produce on various images.
> However, I have found that when I make even minor changes to a script and 
> save the changed script to the ‘plug-ins’ folder under a new name, it will 
> not show up in the Gimp Drop Down Menu specified in the script.
> I would like to know if anyone else has come across this snag and, if so, 
> what is the cause or if there is a solution.

You'll need to restart GIMP for it to pick up a new plug-in.  Once it
appears you can edit it, as long as the menu item hasn't changed.

The "proc_name" must be unique - this is defined in the "register" function.

If there's a syntax error, the plug-in won't load.


Start GIMP in a command terminal to catch start-up errors.

Chris
___
gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list