GIMP Chat
http://gimpchat.com/

Use Shrink or Grow by 1 pixel on command
http://gimpchat.com/viewtopic.php?f=9&t=19222
Page 1 of 1

Author:  contrast_ [ Wed Mar 10, 2021 1:35 pm ]
Post subject:  Use Shrink or Grow by 1 pixel on command

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

Author:  Nidhogg [ Wed Mar 10, 2021 3:13 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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 5059 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 5059 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.

Author:  contrast_ [ Wed Apr 14, 2021 3:48 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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.

Author:  contrast_ [ Wed Apr 14, 2021 3:57 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

https://imgur.com/MmLv3zr

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

Author:  Nidhogg [ Wed Apr 14, 2021 4:28 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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.

Author:  contrast_ [ Wed Apr 14, 2021 4:59 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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.

Author:  Nidhogg [ Thu Apr 15, 2021 8:37 am ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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/

Author:  Pocholo [ Thu Apr 15, 2021 2:06 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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.

Author:  ofnuts [ Fri Apr 16, 2021 8:16 am ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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).

Author:  contrast_ [ Fri Apr 16, 2021 4:23 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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.

Author:  contrast_ [ Fri Apr 16, 2021 5:08 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

Thank you. This is really cool. I recorded myself using your script to make fast stroke text.

https://streamable.com/jbax7b

Author:  contrast_ [ Fri Apr 16, 2021 5:15 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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

Author:  ofnuts [ Fri Apr 16, 2021 5:39 pm ]
Post subject:  Re: Use Shrink or Grow by 1 pixel on command

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)

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/