Post Reply 

Automating a Procedure

Jan 30, 2014, 11:58
Post: #16
RE: Automating a Procedure
I've updated my GIMP version, and now auto-rotate.scm is working fine. Thanks, that will be a BIG help.

I see that auto_rotate.scm has different behavior than did ROT2.py. ROT2.py always rotates the image such that the endpoints of the path are horizontal, which is the exact behavior that I needed.

However, in auto_rotate.scm if the slope of the path is downsloping or upsloping less than 45 degrees, the enpoints are rotated to the horizontal, but if the slope is more than 45 degrees, then auto_rotate.scm rotates the image such that the endpoints are vertical.

I think I might encounter a slope greater than 45 degrees maybe 10% of the time. Is this something that you could modify in the code of auto_rotate.scm?

If not, that's cool. . . auto_rotate.scm will be a tremendous time saver in this project.

Green
Find all posts by this user
Quote this message in a reply
Jan 30, 2014, 11:58
Post: #17
RE: Automating a Procedure
I've updated my GIMP version, and now auto-rotate.scm is working fine. Thanks, that will be a BIG help.

I see that auto_rotate.scm has different behavior than did ROT2.py. ROT2.py always rotates the image such that the endpoints of the path are horizontal, which is the exact behavior that I needed.

However, in auto_rotate.scm if the slope of the path is downsloping or upsloping less than 45 degrees, the enpoints are rotated to the horizontal, but if the slope is more than 45 degrees, then auto_rotate.scm rotates the image such that the endpoints are vertical.

I think I might encounter a slope greater than 45 degrees maybe 10% of the time. Is this something that you could modify in the code of auto_rotate.scm?

If not, that's cool. . . auto_rotate.scm will be a tremendous time saver in this project.

Green
Find all posts by this user
Quote this message in a reply
Jan 30, 2014, 12:00
Post: #18
RE: Automating a Procedure
Hmmm, I only hit the post reply button once, I wonder why it posted twice?
Find all posts by this user
Quote this message in a reply
Jan 30, 2014, 14:38
Post: #19
RE: Automating a Procedure
(Jan 30, 2014 11:58)GreenRite Wrote:  --snip--
I think I might encounter a slope greater than 45 degrees maybe 10% of the time. Is this something that you could modify in the code of auto_rotate.scm?


The mark 1 version of the script acts the way you want. Pulled it out of my archive.

.zip  Auto-rotate-1.scm.zip (Size: 874 bytes / Downloads: 30)
Remember to unzip it before putting in your scripts folder and remove the old one.
Thanks go to the author Hevan. I did a small edit and it now appears in the image menu bar next to 'Help'. Double click to apply.
Might speed up your processing.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Jan 31, 2014, 01:33 (This post was last modified: Jan 31, 2014 11:34 by GreenRite.)
Post: #20
RE: Automating a Procedure
Gimp 2.8.10, Windows 7, 64 bit.

Thanks to Hevan for having authored this script and thanks to rich2005 for having provided it from his archive and having customized it for me, and thanks to all the others who have consulted on this project. This script will save me a lot of time.

There is one other lengthy routine that I follow exactly every time I edit an image, and I'm wondering if there might be a script written for that as well. When I am done cropping the photo, these are the steps I follow:

Click: File
Click: Export As
Click: Local Disk D:
Double Click Folder Icon: DONE
Click: Export
Click: Export
Click: File
Click: Close View
Click: Discard Changes
Click: File
Click: Open

And, like with auto-rotate-1.scm, having a button on the top bar to click to execute the script would be just fabulous.

Can you provide a link to a script that will do something similar? Again, any help is GREATLY appreciated.

Green
Find all posts by this user
Quote this message in a reply
Jan 31, 2014, 09:11
Post: #21
RE: Automating a Procedure
@GreenRite
I do not know of a plug-in/script that does exactly what you require. There are some that offer alternative "save/export" procedures, no shorter at best, dangerous at worst.

Looking at your work flow, it seems the intention is
open image -> edit -> export to new location, preserving the original file unchanged.

You might be able to speed this up by reversing the sequence.
Bulk copy the original files to the new destination. (as Ofnuts suggestion)
Open the copied file
edit
Then instead of export there is an option to "overwrite..filename"

Of course this does not work for many instances, changing file name, changing file format and if using jpg format that pesky quality dialog might show.
but it is worth a thought.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Jan 31, 2014, 11:46 (This post was last modified: Jan 31, 2014 12:05 by GreenRite.)
Post: #22
RE: Automating a Procedure
(Jan 31, 2014 09:11)rich2005 Wrote:  @GreenRite

Looking at your work flow, it seems the intention is
open image -> edit -> export to new location, preserving the original file unchanged.

You might be able to speed this up by reversing the sequence.
Bulk copy the original files to the new destination. (as Ofnuts suggestion)
Open the copied file
edit
Then instead of export there is an option to "overwrite..filename"

Yes, I need to repetitively open an image, edit, overwrite..filename, then open the next image and repeat. The suggestion to use "overwrite..filename" will mean a substantial decrease in clicks to do this part of the process. I have added two extra steps since, once the workflow begins, these steps will always go together. I'm restating them here:

Click: File
Click: Overwrite..filename
Click: Export (to accept the default settings in the quality dialogue box)
Click: File
Press: <Ctrl> <D> (or alternatively, Click: Close View; Click: Discard Changes)
Click: File
Click: Open

I'm hoping that these seven or eight steps can be automated into one double-click of a button at the top. Do you think a plugin can be made to automate these steps? If so, can you recommend someone I can contact to get this work done? As I said before, I can pay a reasonable amount. Or perhaps make a donation to the GIMP project, as I am very appreciative of being able to use this software.

Thanks,
Green
Find all posts by this user
Quote this message in a reply
Feb 1, 2014, 11:13
Post: #23
RE: Automating a Procedure
Does not look like any offers to write a bespoke script or plug-in.

My coding knowledge stopped with FORTRAN (1970) and then (onetime scorned by Ofnuts), PowerBasic in M$Dos days. Wink

What you could try is reassigning some of the keyboard shortcuts see:
http://docs.gimp.org/2.8/en/gimp-concept...tcuts.html

As an example, the operations Open, Overwrite, Close could go on the top row keys: q, w, e
Saves having to open the menus, so a few mouse clicks saved.

A quick video to show what it looks like.

http://www.youtube.com/watch?v=UgAN8uJ-Fqo&hd=1 2 minutes.

Just make sure you are working on copies of the files as discussed earlier.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Feb 10, 2014, 14:09
Post: #24
RE: Automating a Procedure
(Feb 1, 2014 11:13)rich2005 Wrote:  What you could try is reassigning some of the keyboard shortcuts see:
http://docs.gimp.org/2.8/en/gimp-concept...tcuts.html

As an example, the operations Open, Overwrite, Close could go on the top row keys: q, w, e
Saves having to open the menus, so a few mouse clicks saved.

Thanks for the help on the keyboard shortcuts.

So my son is a web-site developer who works mainly in Wordpress and LAMP. He said that he would give writing a script/plugin in Python a go. But he's wondering if there is an existing script/plugin that kind of does some similar things that might give him an example of how the coding is done. Do you know of something that automates some of the mouse clicks / right clicks that would be necessary to automate this procedure (or other procedures)? Any help would be greatly appreciated!

Green
Find all posts by this user
Quote this message in a reply
Feb 13, 2014, 18:59 (This post was last modified: Feb 13, 2014 19:29 by GreenRite.)
Post: #25
RE: Automating a Procedure
(Feb 10, 2014 15:19)ofnuts Wrote:  PM me if you want my mail so that your son can ask me questions directly.

Thanks for the info and offer of help.

I'm going to repost here what I *think* is the complete procedure to do the editing required in GIMP.

Click: File
Click: Export As
Click: Local Disk H:
Double Click Folder Icon: DONE
Click: Export
Click: Export (to accept the default export values)
Click: File
Click: Close View
Click: Discard Changes
Click: File
Click: Open
<Wait While User Opens and Edits Next Image>
<On Click of Button> Loop Back to the Top

As you can see, I've switched back to using the Export feature rather than the Overwrite feature as I would like to avoid having to make the copies of the images that would be required to use Overwrite.

I'm going to email my son a link to this thread but I'm not sure how soon he will be able to get to it.

Thanks again for your help.

Green
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Automating a bunch of quiz cards sponsen 2 718 Jan 9, 2013 00:34
Last Post: BilboMint

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS