Post Reply 

script-fu select from path, gaussian blur, remove active path

Sep 17, 2012, 14:54 (This post was last modified: Sep 17, 2012 15:44 by mark.)
Post: #1
script-fu select from path, gaussian blur, remove active path
Hi,

I'm looking / wanting to create a script that will "Blur" out number/license plates. e.g.

1. I'll manually open the image
2. Use the "path tool" to select the area around the writing manually

Then use script-fu to "automate" the below steps.

1. Select -> From Path
2. Filters -> Blur -> Gaussian Blur >
Horiz = 55.0
Vert = 55.0
Blur Method = RLE
3. Select -> None
4. Delete Path

I've been attempting use the "Script-fu Console" and also "Gimpscripter plugin" - I have attached a copy of the script created by "Gimpscripter Plugin" (which gives an error) but cannot get off of first base!

I'm looking at the command (gimp-image-select-item image operation item) for "Select -> From Path" but cannot find any simple example for a "newbie" to this!

Thanks In Advance.


Attached File(s)
.txt  plugin-wrapper-BlurReg.txt (Size: 11.53 KB / Downloads: 259)
Find all posts by this user
Quote this message in a reply
Sep 17, 2012, 21:58
Post: #2
RE: script-fu select from path, gaussian blur, remove active path
thank you for your reply.. once i had got to grips with the paths tool I seem to have forgot all about the lasso tool.

With using the lasso tool, and a quick play around with Gimpscripter plug-in to apply Pixelize then select none ~ I can "blur" out number plates quickly now!

Again thank you so much for taking the time to reply to my post Smile

PS. will have to look into script tutorials more to get the hang of scripting!

(I have a attached the script, maybe it will be of use to someone. For win7. script goes in C:\Users\<user name>\.gimp-2.8\plug-ins\. rename file back to .py instead of .txt)


Attached File(s)
.txt  plugin-wrapper-WipeReg.txt (Size: 11.28 KB / Downloads: 281)
Find all posts by this user
Quote this message in a reply
Sep 18, 2012, 06:47
Post: #3
RE: script-fu select from path, gaussian blur, remove active path
(Sep 17, 2012 23:42)ofnuts Wrote:  284 lines of code for that? Your whole script is actually down to:

(also, adding items to the Image menu bar ("<Image>/Shortcuts") is considered bad form).

as i said above, i used Gimpscripter plug-in (http://registry.gimp.org/node/25305
) to create the code. I didn't write it, or currently have the knowledge to write it. From my first impressions of using scripting in GIMP.. i'm not liking it, its not user friendly and very limited in working examples of code, hence my initial post here.

(Sep 17, 2012 23:42)ofnuts Wrote:  And, considering that 1) you don't really need to remove the selection once it has run and 2) you can rerun the script with the same parameters using Ctrl-F on all open images, you just need to input the parameters to Blur/Pixelize once, calling your script instead of hitting Ctrl-F has little benefit after the first plate...

1) I needed to remove the selection, as there is more that one number plate in the image, and I didnt want multiple area's selected at the same time.

2) when using multi images e.g. i do hundreds of these. The tool settings resets every time I exit and go back to GIMP. so the CRTL-F repeat action won't work until I have set the tool up again.

(Sep 17, 2012 23:42)ofnuts Wrote:  If only it had an ounce of built-in intelligence (such as self adapting to the plate size)...
Yes I totally agree, but I don't have a clue how to use command you suggested yet. I may look into it in the future, but currently I only interested in a quick solution (the above code was done in less than 1min) to blur out plates.

As stated by many GIMP users, this is where GIMP falls down against other graphic apps. It needs a marco recorder, and at the moment Gimpscripter was the solution for me.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Run script on action rchav 2 1,110 Aug 13, 2018 14:57
Last Post: rchav
  Script Fu Errors Gimp 2.10.4 lightsaber jd3481 1 702 Aug 2, 2018 05:13
Last Post: paynekj
  Script-fu script to conversion pdf to image 4ever 12 13,036 Jul 17, 2018 16:01
Last Post: paynekj
  Problems with a bat script :( ThaUnknown_ 1 563 Mar 26, 2018 21:14
Last Post: paynekj
  Script-fu ordered file list vnicent 1 373 Mar 19, 2018 17:33
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS