It is currently Fri Apr 19, 2024 12:44 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Script request: levels>select_white_pixel, crop, save
PostPosted: Sat Jun 25, 2016 10:58 am  (#1) 
Offline
GimpChat Member

Joined: Jun 25, 2016
Posts: 5
I have a process that I'm doing for thousands of images that I'd like to remove as many keystrokes as possible from.

The process is a loop of:
rectangle tool
* select rectangle
crop to selection
levels > select white eyedropper tool
* select white pixel
overwrite original image (jpeg - bump quality to 100%)
close view (or just "next image" - no confirmation dialog for that)

The starred steps require user input, and the ideal solution would only require user input for those steps (and all confirmation dialogs should auto-confirm). Any steps toward getting there would be appreciated.

I tried to automate the process using xdotool, but I couldn't get GIMP to recognize xdotool's "synthetic" keypresses (see http://gimpchat.com/viewtopic.php?f=8&t=14248). Then, I switched to Windows 7 and GIMP 2.8.14 and tried the same thing with AutoHotKey and got the same result.

I'm using Linux Mint KDE 17.3, which is based on Ubuntu 14, and GIMP 2.8.10, if that matters.


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: Script request: levels>select_white_pixel, crop, save
PostPosted: Sat Jun 25, 2016 11:32 am  (#2) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
crop to selection can be set as a short cut.
select white pixel can be automated if you know what you're selecting ahead of time like brightest pixel or whatever you can't make a script run half way like opening the levels and click on eye dropper tool for you.

_________________
TinT


Top
 Post subject: Re: Script request: levels>select_white_pixel, crop, save
PostPosted: Sat Jun 25, 2016 11:40 am  (#3) 
Offline
GimpChat Member

Joined: Jun 25, 2016
Posts: 5
Thanks, that's helpful. Brightest pixel probably wouldn't work, but it could just use the pixel at (1, 1).

So far I'm just rebinding the keys temporarily from Preferences > Interface > Configure Keyboard Shortcuts:
c - crop to selection
s - overwrite original
w - levels tool

Would ideally like to get it down to:
(select rectangle)
(single keypress trigger the rest, go to next photo, and activate the rectangle selection tool)
. . .


Top
 Post subject: Re: Script request: levels>select_white_pixel, crop, save
PostPosted: Sat Jun 25, 2016 11:55 am  (#4) 
Offline
GimpChat Member

Joined: Jun 25, 2016
Posts: 5
Actually, I could work with something that would just batch:
open all files in folder
levels > select white pixel (1, 1)
save over original

all with no user input, and then I could use another tool that's got better UI for cropping, etc. when working with multiple images.


Top
 Post subject: Re: Script request: levels>select_white_pixel, crop, save
PostPosted: Sat Jun 25, 2016 12:20 pm  (#5) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2419
Much the same, assigning keyboard shortcuts

I tried
A = crop to selection
S = call the levels dialog
D = Save and Close then Open Next File.

which is a script Sequential-processing to close the current file and open the next
see: viewtopic.php?f=9&t=4846&p=182394&hilit=+ofn+file+next+#p60519

Ofnuts has a plugin there as well for numbered files. Easy enough in linux to number files and lose the numbers after editing.

_________________
Image


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Get a mouse click or select a pixel in an image in a python plugin?

3

No new posts Attachment(s) Use of Fuzzy Select tool to remove white background from black text

2

No new posts Gimp dies during crop, IO error LibGimpBase script-fu gimp_wire_read

2

No new posts Attachment(s) Line/pixel size doesnot correspond with pixel resolution

3

No new posts Script-fu select outline of image inside png

1



* Login  



Powered by phpBB3 © phpBB Group