Zoltan Erdokovy
![]() |
You are probably familiar with what the Solid Fill checkbox does in noise nodes. When the same source image is fed to both the Noise and Background inputs then it produces something like this:
![]() Now, I'd like to have a generalized way of doing this: the inputs are a grayscale and a color image. Each continuous area of the same gray value should get the color from the color image, from the location of the "center" of the gray cell (or the average color of the same area on the color image). So the main problems are: - Finding cells. - Finding the center of each cell. Using that position as cell color somehow would be great. Right now I have no idea how to begin so I'd appreciate any pointers. ![]() |
|||
Posted: August 18, 2015 12:56 pm | ||||
ThreeDee
![]() |
Unfortunately there is no easy, nor even a semi-easy approach to doing this in FF.
To generalize it to any input, you would need to find all the flat fill areas in the entire image (within a given threshold). Only way to do that is with a script that checks every pixel in the image against adjacent pixels and keeps record (with index numbers) for continuous areas. You would have to minimize memory usage somehow, such as storing the end points of continuous lines instead of every single pixel. Even at 600x600 it would be pushing the limits of the LUA table capacity. And would likely fail altogether on images that are too complex, i.e. that have too many separate areas. |
|||
Posted: August 19, 2015 3:54 pm | ||||
Zoltan Erdokovy
![]() |
Yeah, good points. Quantizing the grayscale values seems to be a good way to decrease the number of cells on the image (8-16 gray steps?). Then the coloring logic could only work on one particular shade at a time.
So the steps could be like: - User selects "1" brightness index. - Algo looks for grays of 1/8 brightness and collects contiguous areas. - Colors those areas to the coordinates of their centers. - User saves the image and processes it once again with "2". (The filter can tell unprocessed texels from processed ones based on the blue channel.) If it's possible to flush the LUA interpreter manually between passes then maybe the passes could be done with the loop node. Still seems to be too much work for what I need it for... ![]() |
|||
Posted: August 20, 2015 12:22 pm | ||||
SpaceRay
![]() |
If this is what I imagine that you could fill any of the cells generated by FF with a defined source color, could be cool, and I have been trying to find a way of this as seen in this other thread
A "Stones"-like noise with triangular forms? Skybase gave a very good way to fill the cells in a very good way, but do not know if this is what you may want, as I really do not understand exactly what you want. I do not know if this may be related but I found this other thread Cell color from cell area |
|||
Posted: August 21, 2015 3:02 am | ||||
ThreeDee
![]() |
Right. If I were to make such a filter -- and I am not planning on doing so -- I would likely make it a multiple-filter affair, meaning make one filter that only creates the flat gray areas that you can then use with the Lookup Component in another filter. Waiting for the first step every time one changes a setting would be excruciating.
Other programs, more pixel-based, probably do this kind of thing natively. I recall some discussion relating to cell fill with Genetica. |
|||
Posted: August 22, 2015 4:44 am | ||||
Zoltan Erdokovy
![]() |
Hm, that is an interesting thought. I'll whip up a prototype to get some rough idea about the resources needed for the calculations. I'd be fine with a two step process.
|
|||
Posted: August 22, 2015 6:08 am | ||||
Crapadilla
![]() |
</delurk>
Yup, FF definitely needs "Image Segmentation". Here's a super-ancient thread where we discussed it: Clicky! (Note that Vlad did not seem to be very positive about this ever making an appearance in FF.) </relurk> --- Crapadilla says: "Damn you, stupid redundant feature requests!" ;) |
|||
Posted: August 22, 2015 7:00 am | ||||
Zoltan Erdokovy
![]() |
Regions node WANT!!!1
|
|||
Posted: August 22, 2015 9:29 am | ||||
Skybase
![]() |
REGION NODE REALLY WANT.
|
|||
Posted: August 22, 2015 10:30 pm | ||||
Ramlyn
![]() |
Plus one. I would like to have it too.
|
|||
Posted: August 23, 2015 12:29 am | ||||
Zoltan Erdokovy
![]() |
Sadly Vladimir Golovin's explanation of the problems is rather clear so I don't think we'll ever get a proper node. The best idea I have so far is a two step process:
- Step one generates a "coordinates texture" (similar to the one in the first post). - In step two that texture is used in a separate filter to sample an image. Of course step one is the tricky part. The reason it is a distinct pre-processing step is that it runs in an infinite loop, processing the same image from the command line over and over: in every iteration it identifies the next unprocessed cell then colors it by some logic. (Center coordinates, UV space fit to bounding box, etc, see Genetica examples in that other thread.) We keep the first step running until the image is all colored. This part requires very little user input (only the selection of the coloring method) so it can run unattended. The only real issue I can see is cell borders in the coordinates texture as bilinear filtering will produce artifacts during sampling an image. How bad it gets depends on the content of both the coordinates texture and the sampled image. |
|||
Posted: August 23, 2015 3:59 am | ||||
Zoltan Erdokovy
![]() |
Actually, it might be better to use a dedicated tool/app for generating the coordinates texture than bending FF out of shape...
|
|||
Posted: August 23, 2015 4:26 am | ||||
Skybase
![]() |
BOOO. lol. Frankly though yes. Maybe in the ... future. |
|||
Posted: August 23, 2015 7:25 am | ||||
xirja
![]() |
![]() Definitely looking like a bevel, but how to find the center. ![]() _____________________________________________________
http://web.archive.org/web/2021062908...rjadesign/ _____________________________________________________ |
|||
Posted: August 24, 2015 9:51 am | ||||
Zoltan Erdokovy
![]() |
I asked this on the Substance Designer forums but the answer was a vague "Probably, I guess". Does anyone here have SD and willing to look around?
|
|||
Posted: August 24, 2015 10:20 am | ||||
LexArt
![]()
Posts: 256 |
I agree that it would be cool, useful and interesting to be able to fill areas or regions of the image
And as told above it seems that it needs to have a Region Node to be able to make image fragmentation, but is bad that Vladimir does not agree with this as it would be really great and useful if I really understand what this really is |
|||
Posted: March 28, 2016 11:51 pm | ||||
SpaceRay
![]() |
I have SD (Substance Designer 4) but regrettably I have not been able to understand it how it works yet, as it seems to be much more complex node based than FF, and do not have time to learn how to use it. I have seen the video tutorials, but it seems that is much more technical, complex and mainly for experienced professionals than for casual users |
|||
Posted: April 12, 2016 3:10 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,712 Registered Users
+19 new in 30 days!
153,533 Posts
+31 new in 30 days!
15,348 Topics
+73 new in year!
24 unregistered users.