KGtheway2B
![]() |
For some reason this just popped into my head last night and I thought I'd throw it out there.
I think the average color node could be a lot more useful if it was re-interpreted to allow taking the average color of an input. The way it stands now, all you can do is use the average color of the base image, I'd like to see it have a required input that averages the color of what is displayed. You could retain the original functionality by just setting the image node as the input. I'm aware there are probably other solutions for finding the average color using other nodes, but It's my assumption that these would involve inherently slower methods than the average color node uses to determine the image average color. Problems: Updating a node breaks filters that use it. Averaging colors of an input with transparency. Thoughts? |
|||||||
Posted: March 16, 2009 1:48 pm | ||||||||
CorvusCroax
![]() |
I agree! I found myself wishing for just such a node recently! I actually thought that was what 'average color' did, until I started using and and quickly realized that it only works on an input image.
Actually, what I'd really like is for FF to return a SERIES of colors, from a specified image. Say, like a posterize - effect, which finds the 3 - 7 most prominent colors in the image. (Like vectorizing an image in adobe Illustrator and getting swatches out of it) This would allow us to use images as the basis of colors pallettes within FF. Imagine having a complicated pattern maker filter, which you feed images to get nice color combos. (will always beat the randomizer!) (hope this makes sense) |
|||||||
Posted: March 16, 2009 4:03 pm | ||||||||
KGtheway2B
![]() |
||||||||
Posted: March 17, 2009 2:03 am | ||||||||
ThreeDee
![]() |
Hi Corvus,
Fascinating idea. I did a rather complex version of extracting colors from an image: ![]() Doesn't really choose the ones that are used the most, nevertheless does a pretty decent job at extracting colors from the image. It could be simplified greatly to be usable in such context as you describe. A dedicated component would be a few hundred times faster. TD |
|||||||
Posted: March 19, 2009 7:11 am | ||||||||
Vladimir Golovin
Administrator |
Neither of these is the actual problem. We never change the components -- instead, we issue a new version of a component (look into the Obsolete category on the Component bar in the Editor to get the idea). And we can deal with transparency in some way (say, averaging it as well). The actual problem is that to average the colors of some image, one must have said image. And Filter Forge doesn't form intermediate images during the rendering -- it doesn't store component output in bitmaps and pass these bitmaps between components. I believe I already explained the situation with the MinLevel / MaxLevel and Average Color somewhere on the forums, but don't remember where exactly. |
|||||||
Posted: March 19, 2009 7:16 am | ||||||||
CorvusCroax
![]() |
Hi KGtheway2B, yeah, that's what I had in mind. Then each of those colors would be useable as color input in other FF nodes. THinking about this, would want with a couple slight modifications: 1) You'd want a control for the number of colors you want to extract. Somewhere between 1 and 8-ish or so, I suppose. 2) You'd want a checkbox for use alpha or not: ie ignore the color of pixels with 100% tranparency, or not. (As Vlad describes above.)
Hi ThreeDee! Ooo...cool! How does it work? Are the colors useable as node inputs? |
|||||||
Posted: March 19, 2009 1:36 pm | ||||||||
CorvusCroax
![]() |
Hi Vladimir, Interesting. So, we're actually talking about two different types of features / nodes. 1) A node similar to average color which generates multiple colors, which are then useable by inputs. (like KG's thing above) 2) A node similar to average color, but which can take any other bitmapped input, not just the source image. sounds like #2 is not possible, because of the way FF works. So, do you think #1 is possible? Is it possible to construct this using existing FF nodes, like min level / max level? |
|||||||
Posted: March 19, 2009 1:49 pm | ||||||||
KGtheway2B
![]() |
I totally understand, and it's questionable whether including a this as another bitmapped node (like blur) would be worth it for such an obscure use. There is, however, some room for improvement in the node that draws from an external image only, but I'll leave possible details to someone else (mostly because I would never use it ![]() |
|||||||
Posted: March 19, 2009 5:15 pm | ||||||||
Sphinx.
![]() |
A blur with radius at 100% and gaussian unchecked should produce the average color.
You might want to hook up a checker in between your source and blur - with solid fill checked and repeat as low as you can live with (low repeat = low average sample pool). This will shave off a great deal of the time needed for the blur to rasterize its internal bitmap tiles. |
|||||||
Posted: March 20, 2009 1:48 am | ||||||||
Vladimir Golovin
Administrator |
Including a component per se is not a problem, but even bitmap-based components such as Blur do not have a full image of their source input until the last block is rendered. |
|||||||
Posted: March 20, 2009 4:30 am | ||||||||
ThreeDee
![]() |
With some modification, yes.
Rather than trying to explain it, let me make a simpler version that is closer to what you are looking for... |
|||||||
Posted: March 20, 2009 1:16 pm | ||||||||
ThreeDee
![]() |
Here it is. The filter extracts 12 colors from the image and you can look at all the colors at one time or one-by-one.
You should be able to figure out from the filter how it is done. The filter has problems with some images, especially where there are colors that are both close to black and close to white (such as extremely dark red and extremely light red), for it averages the lighness, saturation and hue of each color it picks. The logic for picking the best colors could be improved upon. I'll have to do some more experimentation to try and separate out light, medium and dark colors. Color Palette from Image.ffxml |
|||||||
Posted: March 20, 2009 3:40 pm | ||||||||
ThreeDee
![]() |
Here is also an alternate method for getting the average color from an input image.
This particular snippet compares the two methods, the "blur-the-heck-out-of-everything method" and an "alternate method" that uses much less blur by tiling the image at small size, with the external image average. Average Color from Input.ffxml |
|||||||
Posted: March 20, 2009 4:08 pm | ||||||||
Sphinx.
![]() |
I submitted a filter snippet for calculating average color from an input. The filter adds a few optimization and precision reduction tricks compensate for the rather expensive procedure of calculating a precise average (box blur, radius = 100 gives the exact result in case you're interested in that)
|
|||||||
Posted: March 21, 2009 4:01 am | ||||||||
ThreeDee
![]() |
As to color palette, I got this far:
![]() The filter extracts 24 colors from the image (Life preserver in this case) and graphs how much each color is used. Theoretically, you could then pick the 3-7 colors that are used the most. But since it already takes some 45 seconds to render without trying to select out those 3-7 colors, it is not going to be that useful as a snippet. Perhaps it could be used for simply creating a color palette from an image without trying to make it a snippet? |
|||||||
Posted: March 21, 2009 6:11 am | ||||||||
ThreeDee
![]() |
I talked myself into it... submitted as a Color Palette filter.
|
|||||||
Posted: March 22, 2009 11:55 am | ||||||||
Kraellin
![]() |
cool
![]() If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|||||||
Posted: March 22, 2009 9:24 pm | ||||||||
ThreeDee
![]() |
To add to the wishlist, if the "flat" fill averaged the colors used in that area of the image, many effects would be easier to create...
|
|||||||
Posted: March 23, 2009 3:56 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,714 Registered Users
+19 new in 30 days!
153,538 Posts
+7 new in 7 days!
15,348 Topics
+72 new in year!
16 unregistered users.