Re: [Gimp-user] A sequence of actions

2010-03-31 Thread David Hodson
On Tue, 2010-03-30 at 14:07 -0400, Jay Smith wrote:

 Question: Has somebody written a generic large script or set of scripts
 or library of script components that would allow an ordinary user
 with only the most basic programming skills to grab the bits they need
 for their particular sequence of actions?  Something that a basic user
 could edit down to what they need or cut/paste out the bits they need?

Not quite what you were asking, but DBP is a plugin designed to provide
the most common operations for batch processing (without scripting).
It's limited in its operations (by design and lack of spare time), but
many people find it useful.

-- David


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] A sequence of actions

2010-03-30 Thread Jay Smith
On 03/30/2010 01:22 PM, Michael J. Hammel wrote:
 On Tue, 2010-03-30 at 22:31 +0530, Tarun Samvedi wrote:
 Is there any way of defining a sequence of actions that could be used
 later?
 for instance, if I apply auto-color, auto-contrast and cartoon filter
 to a lot of images, is there a way of defining this sequence so it can
 be done in a single step?
 
 Current version does not support recording actions directly.  Instead
 you need to write a plugin using one of the supported languages: Python,
 Script-Fu or C.  For something simple like this python is probably the
 easiest to learn.  For more complex plugins I write C plugins, but then
 I'm more comfortable with C than Python.

I am glad that Tarun brought this up.

Question: Has somebody written a generic large script or set of scripts
or library of script components that would allow an ordinary user
with only the most basic programming skills to grab the bits they need
for their particular sequence of actions?  Something that a basic user
could edit down to what they need or cut/paste out the bits they need?

I know one could study existing scripts and try to learn from them, but
that is different than a script that is fully commented and designed for
the purpose of taking the modular bits you need to build your own
modular script.

IMHO, the lack of a recording actions function, is the weakest aspect
of Gimp.  Photoshop 5 had this (though it was somewhat limited) along
with batch-running operations  and that was released in May 1998, 12
years ago.

I appreciate that such a recording actions feature will become
available when somebody steps up to create it.  (And no, I do not have
the skills to do so.)

I am sure that Sven will rip me a new one for saying so  though I
have the utmost respect for the folks that have the skills and time to
do such programing, but I want to use Gimp, not learn a program
language.

Jay
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] A sequence of actions

2010-03-30 Thread Tarun Samvedi
Michael, Jay - Thanks for the response :)

I'll be trying to implement the idea for GSoC, was just making sure there is
no way of doing it which is unknown to me.

On Tue, Mar 30, 2010 at 11:37 PM, Jay Smith j...@jaysmith.com wrote:

 On 03/30/2010 01:22 PM, Michael J. Hammel wrote:
  On Tue, 2010-03-30 at 22:31 +0530, Tarun Samvedi wrote:
  Is there any way of defining a sequence of actions that could be used
  later?
  for instance, if I apply auto-color, auto-contrast and cartoon filter
  to a lot of images, is there a way of defining this sequence so it can
  be done in a single step?
 
  Current version does not support recording actions directly.  Instead
  you need to write a plugin using one of the supported languages: Python,
  Script-Fu or C.  For something simple like this python is probably the
  easiest to learn.  For more complex plugins I write C plugins, but then
  I'm more comfortable with C than Python.

 I am glad that Tarun brought this up.

 Question: Has somebody written a generic large script or set of scripts
 or library of script components that would allow an ordinary user
 with only the most basic programming skills to grab the bits they need
 for their particular sequence of actions?  Something that a basic user
 could edit down to what they need or cut/paste out the bits they need?

 I know one could study existing scripts and try to learn from them, but
 that is different than a script that is fully commented and designed for
 the purpose of taking the modular bits you need to build your own
 modular script.

 IMHO, the lack of a recording actions function, is the weakest aspect
 of Gimp.  Photoshop 5 had this (though it was somewhat limited) along
 with batch-running operations  and that was released in May 1998, 12
 years ago.

 I appreciate that such a recording actions feature will become
 available when somebody steps up to create it.  (And no, I do not have
 the skills to do so.)

 I am sure that Sven will rip me a new one for saying so  though I
 have the utmost respect for the folks that have the skills and time to
 do such programing, but I want to use Gimp, not learn a program
 language.

 Jay
 ___
 Gimp-user mailing list
 Gimp-user@lists.XCF.Berkeley.EDU
 https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] A sequence of actions

2010-03-30 Thread Rob Antonishen
Currently the blocks of steps that can be performed are all
contained in the pdb.

There are two different ways to get the same result (a set of actions
that can be repeated in a single call)

1) tap into the history buffer somehow to record then playback
history from a different point in history.  THis would require
modifications to the core, and may not be portable to a gegl model.
2) provide a gui/visual language front-end to the pdb (think
inputs/outputs/connectors) to visually create scripts that either get
turned into scheme in the back end, or get implemented directly.  This
could be done as a plugin that would allow creation, saving and
loading actions.

-Rob A

On Tue, Mar 30, 2010 at 2:17 PM, Tarun Samvedi tsam...@gmail.com wrote:
 Michael, Jay - Thanks for the response :)

 I'll be trying to implement the idea for GSoC, was just making sure there is
 no way of doing it which is unknown to me.

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard shortcuts? [SOLVED]

2007-03-01 Thread Sven Neumann
Hi,

On Wed, 2007-02-28 at 03:31 -0500,
[EMAIL PROTECTED] wrote:
 Quoting Sven Neumann [EMAIL PROTECTED]:
 
  You can write scripts for 2.2 now and continue to use them with future
  GIMP versions. The plug-in and scripting API is backwards compatible. I
  wonder why the example script even goes through the hassle of trying to
  deal with versions.
 
 A valid point. I just dislike deprecation warnings popping up and I  
 was rushing things a bit.

Just start gimp-2.3 with the --pdb-compat-mode=on command-line option
then. The default for the unstable releases is to warn about deprecated
functions being used. But this will of course change for stable releases
and there will by default not be such warnings with gimp-2.4.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard shortcuts? [SOLVED]

2007-02-28 Thread saulgoode
Quoting Sven Neumann [EMAIL PROTECTED]:

 You can write scripts for 2.2 now and continue to use them with future
 GIMP versions. The plug-in and scripting API is backwards compatible. I
 wonder why the example script even goes through the hassle of trying to
 deal with versions.

A valid point. I just dislike deprecation warnings popping up and I  
was rushing things a bit.

Quoting David Gowers [EMAIL PROTECTED]:

 The script as defined above produces an antialiased fill, which is naturally
 the opposite of aliased (aliasing is stairstepping, and antialiasing
 counteracts it.). If an aliased (ie. hard-edged) rendering were preferable,
 (gimp-selection-sharpen image) would be needed before bucket filling.

'gimp-selection-sharpen' is unnecessary because anti-aliasing was  
disabled (the argument set to FALSE) in the 'gimp-path-to-selection'  
call.


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard shortcuts? [SOLVED]

2007-02-27 Thread saulgoode
Quoting Dave M G [EMAIL PROTECTED]:

 The script looks quite complicated to me, but I will endeavor to use it
 as a model for building some other action sequences similar to this.
 Hopefully by changing just one or two things at a time I can get a feel
 for this and create more interesting scripts down the road.

The script appears complicated because it handles differences in the  
PDB interface between version 2.2 and the development version (perhaps  
my comments obfuscated the code as well). If the script only supported  
versions = 2.2, it would be about as simple as a script can be --  
perhaps showing such code would make it more clear (I left out the PDB  
registration function):

(define (script-fu-path-fill-aliased image layer)
   (let* ((path (car (gimp-path-get-current image
 (gimp-image-undo-group-start image)
 (gimp-path-to-selection image path CHANNEL-OP-REPLACE FALSE FALSE 0 0)
 (gimp-edit-bucket-fill layer FG-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
 (gimp-selection-none image)
 (gimp-path-delete image path)
 (gimp-displays-flush)
 (gimp-image-undo-group-end image)
 )
   )

Personally, I would recommend removing the line that deletes the path  
-- paths take up very little memory and you may wish to go back and  
edit them later.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard shortcuts? [SOLVED]

2007-02-27 Thread Dave M G
Saul,

Thank you for continuing to help and explain.
 The script appears complicated because it handles differences in the 
 PDB interface between version 2.2 and the development version
Ah, I see. I had to look up PDB Interface to know what you're talking 
about, but now I get it.

Once version 2.4 is released, and if one were to write the code only to 
support 2.4 and later, and not worry about earlier versions, would that 
also simplify it down? I'm thinking if that were the case, then I might 
wait until 2.4 is out and then get more into scripting. After all, from 
what I've read on this mailing list, a 2.4 release seems just a little 
ways away.

 (perhaps my comments obfuscated the code as well).

No, comments are good! The more comments the better, I think.

 Personally, I would recommend removing the line that deletes the path 
 -- paths take up very little memory and you may wish to go back and 
 edit them later.

For what I'm doing, especially considering the volume of coloured areas 
I'm working with, I'm unlikely to every really need a path a second time.

But I'm developing a little confidence with the scripts, so that if I 
change my mind about that, I think I can easily remove that part of the 
script and have a second version that leaves the path there.


-- 
Dave M G
Ubuntu 6.10 Edgy Eft
Kernel 2.6.17.7
Pentium D Dual Core Processor
PHP 5, MySQL 5, Apache 2
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard shortcuts? [SOLVED]

2007-02-27 Thread David Gowers

Hi,

On 2/28/07, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:


(define (script-fu-path-fill-aliased image layer)
   (let* ((path (car (gimp-path-get-current image
 (gimp-image-undo-group-start image)
 (gimp-path-to-selection image path CHANNEL-OP-REPLACE FALSE FALSE 0
0)
 (gimp-edit-bucket-fill layer FG-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0
0)
 (gimp-selection-none image)
 (gimp-path-delete image path)
 (gimp-displays-flush)
 (gimp-image-undo-group-end image)
 )
   )



The script as defined above produces an antialiased fill, which is naturally
the opposite of aliased (aliasing is stairstepping, and antialiasing
counteracts it.). If an aliased (ie. hard-edged) rendering were preferable,
(gimp-selection-sharpen image) would be needed before bucket filling.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard shortcuts? [SOLVED]

2007-02-27 Thread Sven Neumann
Hi,

On Wed, 2007-02-28 at 08:02 +0900, Dave M G wrote:

 Once version 2.4 is released, and if one were to write the code only to 
 support 2.4 and later, and not worry about earlier versions, would that 
 also simplify it down? I'm thinking if that were the case, then I might 
 wait until 2.4 is out and then get more into scripting. After all, from 
 what I've read on this mailing list, a 2.4 release seems just a little 
 ways away.

You can write scripts for 2.2 now and continue to use them with future
GIMP versions. The plug-in and scripting API is backwards compatible. I
wonder why the example script even goes through the hassle of trying to
deal with versions.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard short cuts?

2007-02-26 Thread saulgoode
Quoting Dave M G [EMAIL PROTECTED]:

 GIMP Users,

 Because of the nature of my work, I have to repeat the same set of
 commands over and over again. (...SNIP...)
 Is there a way I can save a custom sequence of processes, and then, dare
 I hope, bind that sequence to a keyboard shortcut?

I had a few minutes free so I whipped up a script-fu which I think  
will do the task you described. I have even commented it so that you  
might see how it works (and perhaps modify it). I haven't tested the  
script on GIMP 2.2 (I am using a development version) so let me know  
if it doesn't work.

The command is not assigned to a keystroke but you can do so from the  
File-Preferences-Interface-Configure keyboard shortcuts-Plugins  
where you should click on the Fill Path With FG command and then hit  
the key you wish assigned.

NOTE: If you perform an UNDO after executing the command, you will no  
longer see the path because you won't be in edit mode; the path is  
still there but you will have to manually switch back to edit mode.

The script is available at:

http://www.flashingtwelve.brickfilms.com/GIMP/Scripts/Temp/fill-path.scm
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard short cuts?

2007-02-26 Thread Joao S. O. Bueno Calligaris
On Monday 26 February 2007 00:35, Dave M G wrote:
 GIMP Users,

 Because of the nature of my work, I have to repeat the same set of
 commands over and over again. These commands are:

 1. Create a selection from a path (I don't know if there's a
 keyboard shortcut for this)
 2. Select-Sharpen to remove any anti-aliasing (again, I don't know
 if there's a keyboard shortcut for this)
 3. Fill with foreground colour ([ctrl+,])
 4. Deselect the selected area ([ctrl+shift+a], or [ctrl+d] under my
 current settings)
 5. Delete the path (which I currently do by selecting a different
 tool and then selecting the path tool again - I'm sure there's a
 better way)



Hi Dave

I am in a bit of a hurry now, but tin the GIMP there are 2 ways of 
assigining shortcuts to any desired action
.

Please, click in Toolbox-File-Prefrences and interface and read 
the instructions on Dynamic Keyboard shortcuts  or just go from 
there to a shortcut assignment interface.

Also, you should consider makig a script - either in script-fu or 
gium-fu to repeat this sequence - it is actually easy, if you see 
some ofthe .py and .scm files taht come with the GIMP, and check the 
Procedure Database in Toolbox-Xtns-PDB Browser


Regards,
js
--

 I do this over and over again as I colour an image, so if I could
 automate this process it would save me an immense amount of time,
 and probably prevent a lot of potential for human error.

 When I did a Google search for possible solutions to this, I used
 the term batch processing. But in GIMP world this term is
 apparently used to refer to running multiple filters or other
 actions on a file from the command line by creating a script. That
 seems a little different from what I'm after. But I'm afraid my
 imagination for alternate terms is lacking, and I couldn't think of
 any terms that came up with what I was after.

 Is there a way I can save a custom sequence of processes, and then,
 dare I hope, bind that sequence to a keyboard shortcut?

 Thank you for any advice or information.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard shortcuts? [SOLVED]

2007-02-26 Thread Dave M G
Saul, Joao,

Thank you for replying.

[EMAIL PROTECTED] wrote:
 I had a few minutes free so I whipped up a script-fu which I think  
 will do the task you described. ...
 The command is not assigned to a keystroke but you can do so from the  
 File-Preferences-Interface-Configure keyboard shortcuts-Plugins

Wow! Thank you so much! I've downloaded, installed, and assigned a 
keyboard shortcut to the script, and it works exactly as I had hoped.

You've saved me a lot of work, so I really appreciate your effort.

The script looks quite complicated to me, but I will endeavor to use it 
as a model for building some other action sequences similar to this. 
Hopefully by changing just one or two things at a time I can get a feel 
for this and create more interesting scripts down the road.

Thank you Saul, and the GIMP users list, for all your support.

-- 
Dave M G
Ubuntu 6.10 Edgy Eft
Kernel 2.6.17.7
Pentium D Dual Core Processor
PHP 5, MySQL 5, Apache 2
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard short cuts?

2007-02-25 Thread Dave M G
Claus,

Thank you for responding.
 you could write a Script-Fu to do that.

Writing scripts looks kind of hard, as I'm not a programmer or coder by 
nature. But I'm game to try. So I read some of the pages you suggested, 
and also looked up a little info on the web.

I've worked out some of the commands I think I need from the Procedure 
Browser, and then I looked at some other script files already installed 
on my machine to try and get some sense of the syntax. My first draft of 
the script is at the end of this message.

I'm confused on two points.

One is that the names of the procedures in the Procedure Browser don't 
seem to follow the same format as they do in the scripts in my scripts 
directory. In the scripts directory, they use dashes, - in their 
names, like gimp-path-to-selection. But in the Procedure Browser, 
they all use underscores, _, like gimp_path_to_selection. What 
should I be using?

The other is that the parameters often list as their first option to 
specify the image. For example, gimp_path_to_selection, has this at 
the top of its list of parameters:
imageIMAGEthe image

Since I don't intend to be using this script at the command line, and 
will be using it on an image that I will have open in the GIMP GUI, do I 
need to specify this? Or do I need to use some kind of variable that 
specifies the currently active image?

Here is my first draft. If someone could help me make the syntax 
correct, then I think I could use it as a model for continuing to create 
my own scripts.

- colour_flat.scm

; Create anti-aliased colour flats from a path.

(define (colour_flat))

; Convert the path to a selection.
(gimp_path_to_selection)

; Sharpen the selection to ensure it is not anti-aliased.
(gimp_selection_sharpen)

; Fill the selected area with the current foreground colour.
(gimp_edit_fill (GIMP_FOREGROUND_FILL (0)))

; Deselect the currently selected area.
(gimp_selection_none)

; Remove the path.
(gimp_path_delete)

-file ends-

Thank you for any assistance or advice.

-- 
Dave M G
Ubuntu 6.10 Edgy Eft
Kernel 2.6.17.7
Pentium D Dual Core Processor
PHP 5, MySQL 5, Apache 2
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user