YOUR ACCOUNT

Login or Register to post new topics or replies
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Pixel-Based Circle Snippet by ThreeDee
http://www.filterforge.com/filters/6642.html

--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Interesting, but needs explanation!

I remember there was a thread somewhere that enlightened the whole topic, right?
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
Here's the thread which started it all:

http://www.filterforge.com/forum/read...9&TID=5787

It blows my mind that ThreeDee can figure this stuff out so easily.
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
I'll repeat the basic theory here (slightly reworded).

---

The motion blur, at very low settings, offsets the image by one pixel. Thus, you can make a line that is 1 pixel wide in a document of any size by offsetting a thresholded edge by one pixel with motion blur and blending it with the original edge.

If you make this a white line on black background and motion blur this one line to cover the entire image, it seems to disappear, but really doesn't. It just gets smeared across the whole image. But because FF works at 32-bit floating point precision, it really just becomes mixed with the background color. White is now mixed with the background black in the exact ratio of 1/(number of pixels in the image)!*

Thus, this small number or "multiplier" (the near-black image) can be used as the Percentage control for various operations, such as offset. And it will automatically give you a pixel-based Percentage.


---

Now, I should mention that the filter doesn't work exactly like that. It actually generates 2 vertical white lines, so the multiplier ends up being 2/(number of pixels)*. Also, the multiplier is put through a Tone Curve that brings it from the range of 0-2 to 0-100 so that you can get a wider range for the radius of the circle.

For an even wider range, another Tone Curve, along with some other modifications, can be made to bring the range to 0-1000, whereafter you may want to replace the Slider control with an Integer Slider which allows that range. You could probably map the Slider to go up to 10000 or higher, but you'd lose the direct Slider-value-to-pixel ratio.

Moreover, it would actually be better to make the filter generate 10 or even 50 white lines to use for the calculation, as it would be easier to see visually what is going on. Plus it would help fix the slight offsetting that is introduced to odd-numbered tiles when you start pulling down the Size, Pixels slider.

---

I have a feeling I will need to explain this in a more comprehensible manner.

* This has not been mathematically or otherwise been verified. In fact, it appears that the original-theory version results in a 0.5/(number of pixels) and the filter results in a 1.0/(number of pixels) multiplier. Don't know why.
  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,534 Posts
+31 new in 30 days!

15,348 Topics
+72 new in year!

Create an Account

Online Users Last minute:

9 unregistered users.