It is currently Thu Jul 04, 2024 9:24 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 9:55 am  (#21) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Ok, here's an update - I added a function where you can do any shape you like.

The way it works is, you make a selection in the size of the image, and the script scales the selection to the size you've selected in the settings, then makes a grid of that shape. Try it out!

http://www.fileden.com/files/2010/2/7/2 ... grid1_1.py

(also, I rewrote a large part of the script, I think it should be a bit faster now even with other settings)


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 10:35 am  (#22) 
Offline
GimpChat Member
User avatar

Joined: Apr 18, 2011
Posts: 620
Location: New York
Attachment:
hopi2.jpg
hopi2.jpg [ 58.43 KiB | Viewed 1945 times ]


well, that's cute! a very interesting effect

_________________
Ubuntu 22.04, Kernel i686, 5.15.0-107-generic
python3 v3.10.12 ----- GIMP - ver 2.10.30


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 10:48 am  (#23) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
I like the new plug-in but I'm having trouble with the selection one. It comes out very tiny. I may be doing something wrong there. I used the paths tool to make a small random shape then ran the script. I tried it with small rectangle selections and small elliptical ones too and had the same results.

Also, would it be possible to have a reset button?

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 11:04 am  (#24) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
OK, I tried a larger shape, a star that is 150 radius and 75 radius. I stroked it onto the final image. The original image was 500x500px to start with and the script enlarged it to 1105 x 1105px.

I cropped this down to 500x500px.
Image


These are the settings I used.

Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 11:12 am  (#25) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
You need to make the selection in the size of the image. The script automatically scales it to the size you set in the settings.

It's not a perfect system... if the image size gets changed by the script then the shape gets "smaller", because resizing the image also affects the selection (it gets padded with empty space). But it works adequately for now...

here's an example
Selection:
Image
Result:
Image


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 11:26 am  (#26) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
OK. I tried it using a star the size of the image (500x500) and cut the amount of stars down to 4 x & y. That made a smaller image but the stars were decently sized.

I tried making 10 stars using the same settings and it shrank the stars way down and made an image 1055x1055.

Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 11:42 am  (#27) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Oregonian wrote:
I tried making 10 stars using the same settings and it shrank the stars way down and made an image 1055x1055.


You can prevent the shrinking by resizing the image beforehand. For now I can't think of a better fix for that...


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 12:04 pm  (#28) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
dd wrote:
You can prevent the shrinking by resizing the image beforehand. For now I can't think of a better fix for that...

That's the problem with specifying the number of rows and columns. I'd much prefer to just specify the object size and have the entire layer filled with the grid... just like Filters>Render>Pattern>Grid... does it.

I can see some utility for specifying rows and columns that are smaller than the image size.

But I'd be inclined to crop the grid to the existing image/layer size if the rows and columns exceed the existing image or layer size. That's the way I'd want it to work if I were writing it and/or using it.
(I wrote embedded software in a previous life.)

_________________
Image


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 1:29 pm  (#29) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Yes, you may have a point there... I could add a checkbox option to crop the image back to original size after the script is finished.


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon Apr 25, 2011 6:38 pm  (#30) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
I have a couple of issues with the new py grid plug-in.

1. If you don't open an existing image it throws errors when implemented. So, naturally, it requires an image open to use it, however, when you create a grid of any size, of x number of rows and columns, it creates a new transparent layer with the grid that isn't the same size of the original image. I would prefer if the plug-in resized the image to the new grid layer, without me having to make those adjustments.

2. If you use the selection option, and enlarge the size of the shape diameter, the plug-in disregards it. This is not the result I am expecting. If I create a selection and want it to be 100px in size, I would expect the plug-in to make 100 px shapes in a grid.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Tue Apr 26, 2011 4:23 am  (#31) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Well... this wasn't my own code originally, I was just adapting other people's code to suit my needs better... if anyone wants to continue the work with this script, feel free to pick up where I left, I think I'm going to concentrate on my own scripts for now at least.


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Tue Apr 26, 2011 6:06 am  (#32) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Yikes! I hope I didn't touch a nerve. It wasn't my intention to do so.

Just old college computer lab habits of mine when testing other classmates' code (although in an entirely different language). This does not diminish the fact I appreciate your taking the time to do what you did by putting the scripts together into a python file. Thanks a bunch for doing that. :)

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Tue Apr 26, 2011 7:53 am  (#33) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
No, don't worry about it. I just feel that the more I work on this code the messier it gets - probably because it wasn't my code originally, it's written so differently from what I personally would do... I'd have to rewrite the entire script, but I don't think I have the time/energy to do it right now... which is why I'm saying, if anyone wants to continue with this script from where I left off, be my guest. :)


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Tue Apr 26, 2011 8:13 am  (#34) 
Offline
GimpChat Member
User avatar

Joined: Apr 18, 2011
Posts: 620
Location: New York
I just like that fact that I could remove a few extra scripts....I find the chaos of all these scripts a bit annoying.

_________________
Ubuntu 22.04, Kernel i686, 5.15.0-107-generic
python3 v3.10.12 ----- GIMP - ver 2.10.30


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Tue Apr 26, 2011 8:38 am  (#35) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Same here i am very glad dd revised them into one.It's a cool script in my opinion. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Tue Apr 26, 2011 1:04 pm  (#36) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Here's a combined hack -

This one moves the filter to File->Create->Shape Grid (as it creates the image).

it also speeds things up a fair bit by making the selections incremental then filling once at the end rather than filling on the go.

Name and registration changed to avoid conflicts with James' original.

-Rob A>


Attachments:
RMA-Grids.scm [5.83 KiB]
Downloaded 152 times

_________________
Image
Fantasy Cartography and Mapping by RobA
Top
 Post subject: Re: Shape-Grid zip
PostPosted: Tue Apr 26, 2011 2:29 pm  (#37) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
My version didn't have incremental selections... my version made the selection once, then moved the selection for every iteration.


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Sun May 08, 2011 11:11 pm  (#38) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
I had to go back and read the posts on the use of selections for a grid a few times, because dd's script to perform this process is a great one. It just took some time for me to understand what was meant by making the selection the size of the image. Actually, it should have read, make the selection as large as your resulting grid size (with your chosen settings input).

Just in case anyone else stumbles across this and has problems like I did, do the following:

First, just run the plug-in with your desired settings, regardless of the selection size. Once you have your new grid image (everything will be smaller than you expect, but fret not), then resize the selection using the scale tool (mode set to selection), and drag the selection to fit within the new grid layer.

Rerun the script a second time, and turn off the previous layer.

Yes there are other ways to do this, but this way, you don't have to guess what the resulting grid size will be, running the script with your settings will create it for you.

Thanks again, dd!

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Mon May 09, 2011 2:20 am  (#39) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
No problem :)


Top
 Post subject: Re: Shape-Grid zip
PostPosted: Sun Jan 05, 2014 5:56 am  (#40) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
:bump
Nice too see how idea and script evolved

BUT reading now i got a bit confused, related to many scripts a few in several version

which the script that integrate most of shapes ?
and if more then 1 scripts (in the topic are discussed several , Sam Brooklin, Mahvin, RobA, Rod) which the most relevant differences?

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Using the Grid

6

No new posts Attachment(s) Quickly get a themed grid background/art

12

No new posts Spin-art Grid kind'a like Kandinsky's circles but for any image

1

No new posts Attachment(s) Shape 3D Plugin

2

No new posts Attachment(s) Words to shape

2



* Login  



Powered by phpBB3 © phpBB Group