Post Reply 

Any plugin to fill areas with random color?

Jun 1, 2012, 05:15
Post: #1
Any plugin to fill areas with random color?
Hi guys-

I've been scanning the 'Net for a plugin to fill what is probably two-thousand-or-so tiny areas delineated by simple black lines (its a bunch of tiny hexes spread across a rather large area), and I wanted to fill those areas with four different colors, but I wanted it to be a random selection from that palette for each hex...is there any plugin out there that will do that, or am I going to have to do it by hand?
Find all posts by this user
Quote this message in a reply
Jun 1, 2012, 06:44
Post: #2
RE: Any plugin to fill areas with random color?
If you produce the hexes, then it's not hard to have a process to produce them directly with a random color from a finite set of colors. Just create an "image hose" (.GIH brush file) with 4 hexes brushes, one for each color. If necessary you can spread them at random using my density-brush-fill script.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 3, 2012, 23:09
Post: #3
RE: Any plugin to fill areas with random color?
Attached is the XCF of what I'm trying to do:

I'm trying to fill all those tiny little hexes with a set of colors from a 4-color palette (colors are #182434, #304562, #586e79, #a7b9c7).

I tried using "density-brush-fill" and got a "bad file descrip(tor)" error.


Attached File(s)
.xcf  hex.xcf (Size: 2.05 MB / Downloads: 68)
Find all posts by this user
Quote this message in a reply
Jun 4, 2012, 14:23
Post: #4
RE: Any plugin to fill areas with random color?
Hmmm. Not the kind of problem I envisioned... Can't think of any better method than bucket filling each hexagon with a random color from the 4 you have. Of course you have 7K+ hexagons, so I don't see anyone do that by hand. Given that the hexagons are a very regular pattern it shouldn't be to hard to script. If your Gimp is installed with python support(*), I may give it a shot if I need to doodle during a meeting.

(*) your Gimp has the following menu entries "Filters/python-fu", and "Filters/Render/Clouds/Fog..." (and the fog one works).

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 8, 2012, 23:01
Post: #5
RE: Any plugin to fill areas with random color?
Hmmm.

[attachment=1205]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 11, 2012, 01:31
Post: #6
RE: Any plugin to fill areas with random color?
(Jun 8, 2012 23:01)ofnuts Wrote:  Hmmm.

That's exactly the look I wanted. And yeah, I have Python installed. Not many plugins are good without it. Wink
Find all posts by this user
Quote this message in a reply
Jun 11, 2012, 06:39
Post: #7
RE: Any plugin to fill areas with random color?
Almost finished with the plugin (still need to write some doc and make it fit for general consumption). Stay tuned.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 12, 2012, 05:00 (This post was last modified: Jun 12, 2012 05:04 by SilentWynter.)
Post: #8
RE: Any plugin to fill areas with random color?
I cannot thank you enough.

There's no +1 rep on this forum, is there?

EDIT: Oh look, there is. Right there.
Find all posts by this user
Quote this message in a reply
Jun 13, 2012, 12:20
Post: #9
RE: Any plugin to fill areas with random color?
Script "grid-filler-random-color" is here :

The doc: http://gimp-tools.sourceforge.net/tools.shtml
The script: http://sourceforge.net/projects/gimp-too...s/scripts/

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 13, 2012, 18:34 (This post was last modified: Jun 13, 2012 18:49 by SilentWynter.)
Post: #10
RE: Any plugin to fill areas with random color?
Thanks so much. This is really helpful.

Hm...mayhaps a bit too hasty. I'm getting an error: __init__() takes exactly 12 arguments (11 given)

Probably something I'm doing wrong.
Find all posts by this user
Quote this message in a reply
Jun 13, 2012, 19:38
Post: #11
RE: Any plugin to fill areas with random color?
Holey Moley... did a last minute change and added a bug (because, of course, I only tested the "gradient" version). Sorry Blush

Download version 0.1 from the same place...

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 13, 2012, 23:56 (This post was last modified: Jun 14, 2012 00:06 by SilentWynter.)
Post: #12
RE: Any plugin to fill areas with random color?
No worries, mate - if I tried my hand at scripting my own plugin it'd be far, far worse. I appreciate the time you spent on this.

New error message: "could not get pixel (0, 1600) on drawable (ID 529)".
Find all posts by this user
Quote this message in a reply
Jun 14, 2012, 00:22
Post: #13
RE: Any plugin to fill areas with random color?
If you are using your image posted above, it's 2560x1600 so it has no pixel at Y=1600 (numbering starts at 0, so the range is 0-1599). Furthermore the coordinate system in Gimp has Y=0 at the top so your top left corner is (0,0). If you move your pointer over the picture, the pointer coordinates (in pixels, if the units selector is set for this) are displayed in the status bar at the bottom.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 14, 2012, 22:32
Post: #14
RE: Any plugin to fill areas with random color?
Right, I understand that part...but that doesn't help solve the error. The options given in the plugin are for origin only. Are you suggesting I should start at coordinates (1,1) instead?
Find all posts by this user
Quote this message in a reply
Jun 14, 2012, 23:51
Post: #15
RE: Any plugin to fill areas with random color?
You should start at the center of your top left hexagon, which is more or less at (6,7) with steps 38 and 22. This will paint half the grid, in columns. To paint the other half, do a second run with origin at 26,18. This will take time... (5000 hexagons to fill in each run).

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Loading PythonFu Plugin: ImportError for .../python/gimp.so (GIMP 2.8.22/OSX/Py2.7.9) joroek 1 194 Jul 11, 2017 07:26
Last Post: ythgilb
  [Easy] Sobel plugin parameters t4u 2 266 Oct 7, 2014 19:09
Last Post: ofnuts
  Color menuitems in script or plugin Barbie 4 467 Sep 29, 2014 09:51
Last Post: paynekj
  Script fu and Color to alpha john 4 467 Sep 20, 2014 08:46
Last Post: rich2005
  GAP Plugin error windows 8.1gap_ decode_mplayer.exe entry point not found. thegreenman 1 590 Sep 8, 2014 11:55
Last Post: rich2005

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS