YOUR ACCOUNT

Login or Register to post new topics or replies
KGtheway2B
KGtheway2B

Posts: 660
Filters: 34
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?
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
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)
  Details E-Mail
KGtheway2B
KGtheway2B

Posts: 660
Filters: 34
I'm picturing your node corvus, let me know if I get it right:


Notice the Legacy mode- this makes sure we don't break things already using the component.

Still not sure about input images that have transparency.

(Pardon the horrible shop, it was quick and dirty)

  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
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
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
KGtheway2B wrote:
Problems:
Updating a node breaks filters that use it.
Averaging colors of an input with transparency.


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

Posts: 1227
Filters: 18
Quote
I'm picturing your node corvus, let me know if I get it right:
Notice the Legacy mode- this makes sure we don't break things already using the component. Still not sure about input images that have transparency.


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.)

Quote
Quote
ThreeDee wrote:
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.


Hi ThreeDee! Ooo...cool! How does it work? Are the colors useable as node inputs?
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
Quote
Vladimir Golovin wrote:
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.


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

Posts: 660
Filters: 34
Quote

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 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 smile;) )
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
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.
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
Sphinx. wrote:
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.


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.
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Quote
CorvusCroax wrote:
Are the colors useable as node inputs?


With some modification, yes.

Quote
CorvusCroax wrote:
How does it work?


Rather than trying to explain it, let me make a simpler version that is closer to what you are looking for...
  Details E-Mail
ThreeDee
Lost in Space

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

Posts: 1672
Filters: 112
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
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
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)
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
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?
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
I talked myself into it... submitted as a Color Palette filter.
  Details E-Mail
Kraellin
Kraellin

Posts: 12749
Filters: 99
cool smile:)
If wishes were horses... there'd be a whole lot of horse crap to clean up!

Craig
  Details E-Mail
ThreeDee
Lost in Space

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

Join Our Community!

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!

Create an Account

Online Users Last minute:

16 unregistered users.