YOUR ACCOUNT

Login or Register to post new topics or replies
Rico
Rico

Posts: 21
Filters: 2
Circle/Diamond Packing by Rico
http://www.filterforge.com/filters/16093.html

  Details E-Mail
Rico
Rico

Posts: 21
Filters: 2
Thanks to ThreeDee, ddaydreams and SpaceRay for the great advice in getting this filter to be accepted by the Submit Wizard - which I have learnt can be fussy about variations causing timeouts.

Currently the filter will produce a maximum of 5000 circles or diamonds.

It is possible at certain combinations of parameters for the underlying code to produce many more than 5000 - so if you edit the filter and raise the maximum number of 10 circle sets you can play with this.
  Details E-Mail
Ramlyn
Ramlyn

Posts: 2930
Filters: 691
Interesting filter. smile;)

Thanks for posting it.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35

as the thumbnail above is bad

Sorry that I could not open myself yet the filter as it is for FF 11

WOW!! This is really awesome and well done, this is exactly what I wanted to do myself since 10 years ago since this thread about Pattern filling was started by Threedee, and he did it because myself started this other thread about non-overlapping and I have not thanks him enough for making it.

And you have made possible to use also a rotated square instead of a circle.

Now what would be really cool, useful, amazing and helpful is to be able to replace the circles plain color with at least 5 different custom source images. here is an example of what I am suggesting

Congratulations and you have started making filters really great and very well and wish to see what others things you can do.

Quote
Rico wrote:
It is possible at certain combinations of parameters for the underlying code to produce many more than 5000 - so if you edit the filter and raise the maximum number of 10 circle sets you can play with this.


Does this have a possible relations with this other comments from ThreeDee made in this Unit component thread ?

Quote
ThreeDee wrote:
Unfortunately the current implementation wrecks about 9 out of 10 loop-based ideas I have.
  Details E-Mail
Rico
Rico

Posts: 21
Filters: 2
Hi SpaceRay, thank you for your kind comments.
Quote
Sorry that I could not open myself yet the filter as it is for FF 11

I think you could easily edit the .ffxml file to change the FF version - the filter does not rely on any particularly new features.

Quote
Does this have a possible relations with this other comments from ThreeDee made in this Unit component thread ?

I don't think so, no. The loops ThreeDee is talking about are quite different I think.

As for filling the circles with images - I think that would not be too difficult to achieve - I think you could probably edit the render code to call in pixels from other sources. The images would have to fit within the boundaries of the circles or diamonds.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
Rico wrote:
The images would have to fit within the boundaries of the circles or diamonds.


Yes, of course, the images would fit inside the circle or diamonds and this is really what I want and suggest

Quote
Rico wrote:
As for filling the circles with images - I think that would not be too difficult to achieve - I think you could probably edit the render code to call in pixels from other sources


Good news that it could be possible in some way, although I can not do it myself because I have no idea and no knowledge of coding and programming

Idea suggestion 1 BLEND WITH IMAGES
- Be able to replace the plain color with images AND keep the overlay source color of the original as it already happens now, so it really would be a Blend between what is now and another version with images

If this one can only use just one source image (and not 5 or 10) would be good too because they would change according to source colors blending

Idea suggestion 2 - REPLACE PLAIN COLOR WITH IMAGES WITH THEIR OWN ORIGINAL SOURCE COLORS

In this one you would replace totally the plain color with the image (as it happens already by default in the color control component) with its own original colors that fits inside the circle shape.

What I do not know is if you would need to use just one only source image or it could be possible to have 5 or 10 different ones to mix randomly that would be really much better and be able to mix different images that fits inside the circle shape

I could do it myself if you tell me how to do it

Thanks very much for any possible help and would be much appreciated although of course you are free to do to what you want and can
  Details E-Mail
Rico
Rico

Posts: 21
Filters: 2
Hi SpaceRay,

I understand what you're after but I don't have the time to do this I'm afraid. If you want to do this yourself then you will need to learn some coding I think. The code required is not that complex and you can build on the filter as it exists to get to where you want - it's just the rendering code that need to change.

Since writing the filter I have expanded on it a good deal for myself to create generative images not based on an input image. I got some great results that I really liked, but I could not get FilterForge to go as far as I wanted it to because of it's timeout issues, which the user/developer has no control over.

So I did some digging around in google and discovered a fantastic platform I had not yet heard of called Processing. I ported the Lua code from my filter into Java in Processing and since then I have not touched the filter version as the Processing version can provide so much more performance. I am happy to supply you with the Processing code for circle packing if you like.

There are some really great tutorial videos available for Processing by one of the authors that will teach you coding from scratch.

I still love FilterForge, but for this object packing task I prefer to use Processing as it gives me the performance I need - for example I am able to build a 6000 x 4000 image and fill it with 20000 polygons (of 30 different types) in 25 seconds. Polygon packing is several orders more processor-intensive than circle packing, so I am really pleased with this performance. It means I can do so much more trial and error to get to the images I want.
  Details E-Mail
emme
Posts: 718
Filters: 8
Nice work Rico!

Yeah Processing probably is better suited for this kind of thing.

I made an attempt at circle packing a few years back. The code was ported from Processing if I remember correctly. It has a couple of different output modes that give it some flexibility - for mapping images and stuff. Should be able to do what you're talking about SpaceRay.

CirclePacking v003.ffxml
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
Rico wrote:
I understand what you're after but I don't have the time to do this I'm afraid. If you want to do this yourself then you will need to learn some coding I think


Thanks very much and is much appreciated the long and detailed explanation

Sorry that I can not not learn some coding and of course I understand that you can modify this and there is no problem is only of course if you wanted and could do it

Quote
Rico wrote:
So I did digging around in google and discovered a fantastic platform I had not yet heard of called Processing. I ported the Lua code from my filter into Java in Processing and since then I have not touched the filter version as the Processing version can provide so much more performance.


I really know since 10 years ago the awesome and amazing Processing software that is really very powerful and full of potential in the same way as filter forge BUT I have never been able to use it because it is all based on coding and unless you already have the code already written I do not know how to use it, and is true that it has much more performance

Quote
Rico wrote:
I am happy to supply you with the Processing code for circle packing if you like


Yes, please, I would be great and happy if you can send the code that you already have made and I can try and see if I can use it . If you want you can put it here replacing the .pde extension with the .ffxml extension so you can upload here
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
emme wrote:
I made an attempt at circle packing a few years back. The code was ported from Processing if I remember correctly. It has a couple of different output modes that give it some flexibility - for mapping images and stuff. Should be able to do what you're talking about SpaceRay.


Thanks very much for sharing this and I will try it and see what it can do
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Here is a post I made in 2012 about finding what Processing.org could do buy regrettably could not use it

Processing generative art thread from 2012
  Details E-Mail
Rico
Rico

Posts: 21
Filters: 2
@SpaceRay sorry for the late reply.

Quote
Yes, please, I would be great and happy if you can send the code that you already have made and I can try and see if I can use it . If you want you can put it here replacing the .pde extension with the .ffxml extension so you can upload here


The processing file is attached here - you'll need to change the extension to .pde. I added a bunch of comments to explain a bit about what is happening.

Quote
I really know since 10 years ago the awesome and amazing Processing software that is really very powerful and full of potential in the same way as filter forge BUT I have never been able to use it because it is all based on coding and unless you already have the code already written I do not know how to use it, and is true that it has much more performance


It's never to late to try something new - I would highly recommend starting here - https://hello.processing.org/ - you might be surprised!

good luck with the code above.

Processing_file_Circle_packing_2.ffxml
  Details E-Mail
Rico
Rico

Posts: 21
Filters: 2
@SpaceRay this is also a fantastic resource for starting out coding in Processing: https://happycoding.io/tutorials/processing/
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
Rico wrote:
The processing file is attached here - you'll need to change the extension to .pde. I added a bunch of comments to explain a bit about what is happening.


First of all thanks very much for the file and much appreciated the additional comments explaining some of the code that is very helpful and useful to be able to use it and be able to customize it.

Finally I have been able to download the Processing 4.0 beta 3 and open it

I downloaded your file, changed it to .pde extension, and just with double clicking the file it will be directly loaded into Processing

Then you just click Run and it WORKS!

I have changed the resolution to 1000 x 1000 to see it better how it works and disabled the exit in line 54 because you can not see the result as it closes.

It takes some time to process the 15.000 items but here is the first result with the defaults values already given. It would be good if each of the dot could be shown while it is being processed, positioned and painted.

  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
In the previous example there is really much empty space between the circles because of the values given but if you change the values to the following

float mindist = 0.05; // minimum distance between circles
float edge_distance = 25; // distance from edge of image
float minrad = 5; // minimum size
float maxrad = 500; // maximum size
int ellipse_count = 35000; // number of item to try to make

it will really show the real power of the script to do true perfect circle packing

In the console is put that the count is 35000 but created 15072, so does this mean that it only created 15.072? because I think that it could not fit more circles according to the minimum and maximum size given

  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
As this thread is about the Circle/Diamond Packing filter by Rico that is able to beautifully and awesomelly convert a source image into an amazing galaxy of different sized dots using the source colors I wonder

How could this be done with the Processing script ?

What I do not know is how the colors are taken and given in the script? How to change the red and black shades?
Would be possible to take the colors source from a given source image?

Would there be any possible way that Processing could replace the plain color with a source image?
Quote
Rico wrote:
@SpaceRay this is also a fantastic resource for starting out coding in Processing: https://happycoding.io/tutorials/processing/


Thanks really very much for this link that seems to be very interesting and useful

http://www.complexification.net/gallery/ is a more complex examples of processing as the source code is included already inside the applet after launch
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Apart from the Processing option above given by Rico that is still has no image possible inside the circles, emme has been able to do it in FF

Quote
emme wrote:
I made an attempt at circle packing a few years back. The code was ported from Processing if I remember correctly. It has a couple of different output modes that give it some flexibility - for mapping images and stuff. Should be able to do what you're talking about SpaceRay.


Thanks very much for sharing this and showing how to apply the image over gradient circles.

YES! you are right, this is just the thing I wanted to have in FF and it seems to work right and well and looks really cool

Although is not a big problem and I like how it is now, I find that this does not fit all the circles inside the available space (as it happens correctly shown in the above example with processing) and some are circles are cropped, I do not know if it would be possible in some way, it would be really good if optionally you could also make that all circles fit inside the available space, although maybe it could be difficult to do

Here is an example I have just made with default values but with 10.000 FF Lionfish it looks very well done the good packing done

  Details E-Mail
emme
Posts: 718
Filters: 8
Quote
SpaceRay wrote:
it would be really good if optionally you could also make that all circles fit inside the available space


Looks like I did also make a version that fits the circles inside the image bounds smile:)

CirclePackingSquare v003.ffxml
  Details E-Mail
emme
Posts: 718
Filters: 8
Oh, and in case you want to use non-square images, just change lines 43 and 47 to:
Code
elseif circle.x + circle.r > sizex then
elseif circle.y + circle.r > sizey then
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
emme wrote:
Looks like I did also make a version that fits the circles inside the image bounds


WOW, this is really amazing and awesome how all the circle packing is contained and fits all inside the image bounds in such great way considering that is using FF

Thanks very much for sharing this, much appreciated

this is with 10.000 points

  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
And the best of all is that you can switch to IMAGES that replaces the circles !!

Here is the same with 10.000 lionfish and it works really great

  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
And furthermore what is very important, useful and great is that you can also use source image with PNG transparency where you can also change also the background, or even more copy and paste the small fish over the empty space around the big images to make it even more tight packing

  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Thanks very much to emme for sharing the filter showing how the images can replace the gradients and I will try myself to use the same technique and trick with this great filter by Rico in this thread to add the gradients and so be able to have the awesome results of this filter with images replacing the plain colors, so you can have the option to have the beauty of the original source colors or the image or optionally replace them with small images filling the dots.

Thanks both Rico and emme for making this possible.
  Details E-Mail
David Roberson
Artist
Posts: 404
Filters: 36
Quote
Rico wrote:
I think you could easily edit the .ffxml file to change the FF version - the filter does not rely on any particularly new features.


I often run into this problem since switching back to FF9 after my frustration with my non-Studio FF10 finally got to me. I have not upgraded (probably will wait for ff12) since I don't need any of the newer features for the stuff I do, mostly. I do miss being able to check out newer filters, though. What exactly needs to change in the .ffxml in order to open it an older version like FF9?
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,711 Registered Users
+18 new in 30 days!

153,531 Posts
+39 new in 30 days!

15,347 Topics
+72 new in year!

Create an Account

Online Users Last minute:

24 unregistered users.