YOUR ACCOUNT

Login or Register to post new topics or replies
ronviers
lighter/generalist

Posts: 4456
Filters: 35
If I place the output of this filter into cs5 I get a white fringe. I can remove the fringe using Matte>Defringe-1 pixel. Should I have to do that? Is there something I can do inside ff so it does not output that fringe?

I am testing with a 2k x 1k file - exr 32bit uncompressed

Thanks
@ronviers
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
Forgot to attach the filter. smile:blush:

AlphaTest.ffxml
@ronviers
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
I changed the attached filter because I had bumped the threshold up a bit to see if that would eliminate the fringe - but it seems to me that it should work, without a fringe, with the threshold set at zero.
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I guess this is what happens:

You set up FF with a new image that is 100% transparent white.
When the anti-alias process kicks in, the white color from the outer transparent region contributes to the anti-alias sum of the semi transparent edge region.

If this is really what is going on, it could be a sign on flawed anti-alias calculation in FF (a sub sample should be scaled by its alpha when added to the sample sum, and the sample sum should be divided by the sum of alpha values from the sub samples)

To fix it for this case, ensure that the background is 100% transparent black when you set up New Image background color..
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
That did it! smile:D Thank you very much. At least for now, for me, it will fix it in every case, but I can see how this could be a problem later.
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Great smile:-) I first thought it was the blending of the filter output onto the input image that was wrong, but it works as it should.

I'd say this is a bug, but hopefully a programmer will comment on that..

- Btw.: The Blur component can do similar things.. I think that could be improved with the same solution too..
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
In other cases, where I will have arbitrary values along the alpha edge; will a 1 pixel defringe in photoshop always be enough? Does aa pull from more than one pixel out? Is there a way I can determine from my aa setting how many pixels to trim?
Just out of curiosity; is the error on both sides of edge, and just hidden on the bit side, or is it just on the alpha side?
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
No, the span is never more than one pixel width: think of the pixel area being divided into several subpixels which then is averaged.. If the span was larger than one pixel, it would give you a blurred result.

With your ellipse example, the actual edge of the ellipse goes through the pixel area, so inside one "pixel" you can have both outer transparent region and ellipse. Thus when the aa sum is calculated it uses both ellipse and out region samples.

EDIT: In the attached image, imagine that the blue grid represent pixel cells in the final rendering - each cell will end up being one solid color (the pixel value). You can easily see whats going on in the cells both covering ellipse edge and background - they will be reduced to just one pixel value and that value will be mixed ellipse and background.

You can only solve this when you have a simple solid color outer region (like black for the ellipse), so you can set up the new image with this color (100% transparent).

So actually there is a problem when you have variation in the edge colors..
I can't see how it is possible to solve that without fabricating a special transparent version of the rendering (which FF is not capable of) with another program.

You can try this:
1. Render a temporary version of your filter that is completely opaque.
2. Open image in PS and give it a 100% transparent mask (you need to convert BG to layer)
3. Save in format that supports alpha (for example PNG 24)
4. Open image in FF and render your original masked version of the filter onto that

This workaround should do the trick (but I haven't tested it) - and don't worry about the lower bitdepth of the temporary PNG, its just to get the edges right, it will not degrade things visually

  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I found a better workaround:

In your filter add an Image component somewhere (it must be in use, but you can hook it up to background in a blend with opacity at 100 or something) - then FF assumes you're doing the blending yourself and you can define content in transparent areas..

The AA renders fine this way, regardless of shifting colors smile:)
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
I can confirm that both workarounds work perfectly. I like the high coolness factor of the first method but the second method is so much easier.
I can't thank you enough for working this out and the clear explanation of what is happening. smile:)
I will attach the filters I was using for testing in case anyone else needs to do this.

Method 1 test:

AlphaTest2.ffxml
@ronviers
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
Method 2 test:

AlphaTest3.ffxml
@ronviers
  Details E-Mail
Mike Blackney

Posts: 375
Filters: 57
Thanks for the info, I posted about this a few years back but from memory there wasn't an easy way to resolve it code-wise. This is way better smile:D
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,711 Registered Users
+18 new in 30 days!

153,533 Posts
+38 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

28 unregistered users.

Recent Forum Posts: