YOUR ACCOUNT

Login or Register to post new topics or replies
Zoltan Erdokovy

Posts: 204
Filters: 24
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. smile:)
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
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.
  Details E-Mail
Zoltan Erdokovy

Posts: 204
Filters: 24
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... smile:)
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
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
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
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.
  Details E-Mail
Zoltan Erdokovy

Posts: 204
Filters: 24
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.
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
</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!" ;)
  Details E-Mail
Zoltan Erdokovy

Posts: 204
Filters: 24
Regions node WANT!!!1
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
REGION NODE REALLY WANT.
  Details E-Mail
Ramlyn
Ramlyn

Posts: 2930
Filters: 691
Plus one. I would like to have it too.
  Details E-Mail
Zoltan Erdokovy

Posts: 204
Filters: 24
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.
  Details E-Mail
Zoltan Erdokovy

Posts: 204
Filters: 24
Actually, it might be better to use a dedicated tool/app for generating the coordinates texture than bending FF out of shape...
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
Quote
Sadly Vladimir Golovin's explanation of the problems is rather clear so I don't think we'll ever get a proper node.


BOOO. lol.

Frankly though yes. Maybe in the ... future.
  Details E-Mail
xirja
Idididoll Forcabbage

Posts: 1698
Filters: 8
Quote
Here's a super-ancient thread where we discussed it: Clicky!




Definitely looking like a bevel, but how to find the center. smile:?: Don't know that Substance designer can do that either.
_____________________________________________________

http://web.archive.org/web/2021062908...rjadesign/
_____________________________________________________
  Details E-Mail
Zoltan Erdokovy

Posts: 204
Filters: 24
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?
  Details E-Mail
LexArt
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
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
Zoltan Erdokovy wrote:
Does anyone here have SD and willing to look around?


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
  Details E-Mail

Join Our Community!

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!

Create an Account

Online Users Last minute:

24 unregistered users.