It is currently Thu Jul 04, 2024 4:04 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Use Shrink or Grow by 1 pixel on command
PostPosted: Wed Mar 10, 2021 1:35 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1456
I am a very technical gimp user. I would like to know if I could make a script that would shrink or grow a selected region by one pixel on command? Is there anyway to go about doing this. It would be very important for my workflow. Thanks


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: Use Shrink or Grow by 1 pixel on command
PostPosted: Wed Mar 10, 2021 3:13 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
This is faster than launching a script.
In the preferences: Dialog defaults set up grow and shrink defaults to 1 pixel.

Attachment:
shrinkgrow.png
shrinkgrow.png [ 34.96 KiB | Viewed 5051 times ]


Then, in the preferences: Interface, create shortcuts for grow and shrink.
Using a key combo wins!

Attachment:
shrinkgrow2.png
shrinkgrow2.png [ 42.93 KiB | Viewed 5051 times ]


A script would be easy to write I guess, there's just 2 procedures
gimp-selection-grow and gimp-selection-shrink, but in my opinion it would be a useless script.


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Wed Apr 14, 2021 3:48 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1456
Thanks for your help, but I want it to automatically scale up and down without bringing up the "grow/shrink dialog". This doesn't seem to do that.


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Wed Apr 14, 2021 3:57 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1456
https://imgur.com/MmLv3zr

The goal would be to press a key to grow and shrink the "marching ants" selection. Skipping the dialog entirely.


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Wed Apr 14, 2021 4:28 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
I guess you need (to write) a script that does it without the dialog then.
It's a good first goal and you will score way sooner than me, if I start now it will be ready around Christmas.


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Wed Apr 14, 2021 4:59 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1456
Where are some resources that I can learn how to make Scripts for Gimp? Will I be using the Script-FU? I'm definitely up for this challenge.


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Thu Apr 15, 2021 8:37 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
I'd just google for it, read the basics first and do some beginner tuts.
Python is more popular nowadays for many reasons, but you have to decide that yourself.
Maybe you want to try scheme for this easy script.

https://www.gimp.org/tutorials/Basic_Scheme/

https://gimpbook.com/scripting/


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Thu Apr 15, 2021 2:06 pm  (#8) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
For me the easier is Python. With Scheme, you have to keep refreshing every time you write a section of the code. With Python, you only do it once you register the plugin with GIMP, you can make any changes without refreshing.

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Fri Apr 16, 2021 8:16 am  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
See "ofn-shrink-grow-selection" on https://sourceforge.net/projects/gimp-t ... s/scripts/

A script dedicated to Scrum masters and their boring "daily" "ceremonies" (yes, they have a strange vocabulary, it's the new business cult).

_________________
Image


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Fri Apr 16, 2021 4:23 pm  (#10) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1456
ofnuts wrote:
See "ofn-shrink-grow-selection" on https://sourceforge.net/projects/gimp-t ... s/scripts/

A script dedicated to Scrum masters and their boring "daily" "ceremonies" (yes, they have a strange vocabulary, it's the new business cult).


The script was updated 30 minutes ago? What does it do. I am testing it now.


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Fri Apr 16, 2021 5:08 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1456
Thank you. This is really cool. I recorded myself using your script to make fast stroke text.

https://streamable.com/jbax7b


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Fri Apr 16, 2021 5:15 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1456
It is still kind of rough along the edges. Default grow does not have this problem. I am still going to keep this script as I find it useful.
https://i.imgur.com/3YUzXwS.png


Top
 Post subject: Re: Use Shrink or Grow by 1 pixel on command
PostPosted: Fri Apr 16, 2021 5:39 pm  (#13) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
contrast_ wrote:
ofnuts wrote:
See "ofn-shrink-grow-selection" on https://sourceforge.net/projects/gimp-t ... s/scripts/

A script dedicated to Scrum masters and their boring "daily" "ceremonies" (yes, they have a strange vocabulary, it's the new business cult).


The script was updated 30 minutes ago? What does it do. I am testing it now.


Just code optimization. I figured out away to cut the code by a good third (20 lines from 34)

_________________
Image


Top
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Shrink Grow Feather Selection with LIVE PREVIEW

43

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

3

No new posts Attachment(s) HELP - SEARCH AND RUN A COMMAND

6

No new posts Attachment(s) Pixel Art Help

2

No new posts How do you run GIMP from the command line?

1



* Login  



Powered by phpBB3 © phpBB Group