Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ofn-random-pattern
#1
This plugin is an equivalent of bucket-fill with patterns, except that it uses several patterns at random. In other words, provided with an image like this:

   

It creates this:

   
Available at the usual place.

Enjoy.
Reply
#2
Very cool Mr ofnuts.
The beauty of 'random' is you get a different result every time Big Grin Big Grin
Reply
#3
(12-22-2023, 10:32 PM)Tas_mania Wrote: Very cool Mr ofnuts.
The beauty of 'random' is you get a different result every time Big Grin Big Grin

I wish it were true... The plugin uses HSV noise but there is no access to the random seed in the API so you technically get the same pattern of pixels every time. I sort of hide this by randomly offsetting the layer (so the pattern is shifted) and shuffling the pattern layers. But I'm still trying to find a better solution.

Hmmm. But as I speak I have a solution, the pattern I need is very small (a pixel for each "tile") so instead of generating a tiny layer, I can generate a large layer of random pixels (always the same since I can't control Gimp seed) that I cut at random coordinates, this randomness coming from the Python side, where I can control the seed. Stay tuned Smile

Otherwise, no difficulties to report?
Reply
#4
I recently used a 'randomizer' to generate fractals. It randomizes up to 4 parameters of a fractal. The results are often not good to use but are always different.

I guess you have to work with the API rather than applying values to it. All I can add is the unix rand app is only about 30kb but python must also have a random number generator. Good luck with what you are doing.
Reply
#5
Nice!
Patrice
Reply
#6
Tim made a similar one that was posted on the old Gimp Learn.

It was designed to make Truchet patterns.


Attached Files Thumbnail(s)
   
Image(s)
   

.zip   Truchet.zip (Size: 1.35 KB / Downloads: 62)
Reply
#7
(12-23-2023, 06:04 AM)Blighty Wrote: Tim made a similar one that was posted on the old Gimp Learn.

It was designed to make Truchet patterns.

I claim much better performance. On a 45x20 pattern (the balls) laid out in a 20x20 grid: Tin's script takes 28 seconds, while mine takes less than two. The way it is written Tin's script loops on each item of the final image, so its execution time is proportional to the total number of copied tiles. By contrast my script uses a bucket-fill, so its run time is mostly proportional to the number of source tiles.

Also, abides to selection, and works on current layer & image. Choose wisely Big Grin

PS: Just uploaded a new versions that fixes the randomness problem.
Reply
#8
Another upload to fix a problem with transparent patterns Rolleyes
Reply
#9
Just discovering the Tin's plugin (thanks to Blighty), thus I did few tests  Big Grin
Tests made with the Ofnuts' latest transparency fix as well.

The final size of the file/resources difference is quite big (below on an image of 6025x6675 px 36 tiles)

Truchet result : 2.5 GB (with random flip activated)
   

Random pattern from tiles result : 39.5 GB
   

my computer started to reach its limit as I had time to see clearly what was going on, on the mask while the random pattern from tiles' script was running
Ofnuts, is there a way you can lower that end result size?

The random flip of the truchet is nice, it makes randomness looks more random or it looks like we have more patterns as the same pattern once flipped can look like another pattern
Just a suggestion to Ofnuts to add a random flip horizontal and flip vertical as separate options Big Grin
   
Patrice
Reply
#10
(12-23-2023, 04:06 PM)PixLab Wrote: Just discovering the Tin's plugin (thanks to Blighty), thus I did few tests  Big Grin
Tests made with the Ofnuts' latest transparency fix as well.

The final size of the file/resources difference is quite big (below on an image of 6025x6675 px 36 tiles)

Truchet result : 2.5 GB (with random flip activated)


Random pattern from tiles result : 39.5 GB


my computer started to reach its limit as I had time to see clearly what was going on, on the mask while the random pattern from tiles' script was running
Ofnuts, is there a way you can lower that end result size?

The random flip of the truchet is nice, it makes randomness looks more random or it looks like we have more patterns as the same pattern once flipped can look like another pattern
Just a suggestion to Ofnuts to add flip horizontal and flip vertical as separate options  Big Grin

If you want Flip/Rotate you can duplicate and flip/rotate the layers in the patterns image. You can even make 45° rotations if you want. Dealing with each tile individually is what kills the performance of Tin's script.

This said, starting from scratch, I get this:

   

So, nowhere near what you get, and if the image is around 10G, the dash board only reports half of that... So the figures you show may have something to do with previous history of the image and with its unmentioned precision.
Reply


Forum Jump: