Sphinx.
![]() |
Set Alpha Component
When Set Alpha component is used, it overwrites what alpha there might be prior to this action. While it is useful in some cases, I don't think its the right default behaviour. Mostly the images we load doesn't contain alpha channels, so we simply don't notice this. I think the correct action would be to multiply the present alpha values with the new alpha. It would be nice if you could add a checkbox in the Set Alpha component ("Combine Alpha" or something). It is somewhat annoying that you have to set up a "get alpha -> blend (multiply current alpha with new alpha) -> set alpha" each time.. Blend Component With some blendmodes the blend component is in particular strange regarding alpha handling. Take linear burn for example - if opacity is < 100 % the foreground is mixed with the background color in areas where the background alpha is zero. I have attached a filter graph that illustrates the problem. The blendmodes that shows problem in this setup are: Color Burn, Linear Burn, Color Dodge, Linear Dodge, Vivid Light and Difference. Default processing modes for various components Some components, like blurs, will process the alpha channel, others don't, which I find somewhat confusing. I think that processing modules (and maybe also some of the adjustment modules) should have an option called "Process Alpha". For example the highpass component ignores the alpha, but the low pass ("blur") doesn't. ![]() |
|||
Posted: December 4, 2007 3:48 am | ||||
Vladimir Golovin
Administrator |
Huh?? I just checked it -- the alpha isn't ignored. As for the Blend modes, yes, different mode handle alpha differently. This is because our blending modes behave the same way as Photoshop blending modes, alpha included. We didn't change this -- we wanted the blending modes to be familiar to anyone who used Photoshop. |
|||
Posted: December 4, 2007 6:40 am | ||||
Sphinx.
![]() |
What I mean is that if you blur (low pass) an image with alpha channel, the alpha channel is blurred, but if you high pass, the alpha is not high passed.
And no, the blendmodes does not behave like in Photoshop, thats the reason why I'm bringing this to your attention. Look at the filter graph example above.. if you set up a similar case in photoshop, you don't get a pink tint (from background areas where alpha is zero) all over the foreground. Here's a screenshot from photoshop with a similar setup (same blendmode, same foreground, same background, same opacity): ![]() |
|||
Posted: December 4, 2007 7:01 am | ||||
Sphinx.
![]() |
I tried applying the foreground mask (to alpha) and rasterize the solid color fill - its the same as seen above (i.e. in PS it doesn't matter if you use masks or applied alpha).
If you compare the image to the final component in the FF screenshot, you can see that in FF the pink fill of the BG is visible all over the result, also in areas where the background alpha is zero. |
|||
Posted: December 4, 2007 7:12 am | ||||
Vladimir Golovin
Administrator |
Could you post the filter you used in the example above?
|
|||
Posted: December 4, 2007 8:52 am | ||||
Vladimir Golovin
Administrator |
Also, you're using PS CS3 -- that might well be the reason why you see the difference, since they may have new algos for blending modes. When we worked on the blending modes, we used PS CS.
|
|||
Posted: December 4, 2007 8:59 am | ||||
Sphinx.
![]() |
attached. AFAIK, the different blendmodes should not affect the alphablending/combining. I have working code if you are interested. Blendmode_Alpha Problems.ffxml |
|||
Posted: December 4, 2007 9:05 am | ||||
Vladimir Golovin
Administrator |
Again, our policy regarding the blending modes was that they behave exactly as in Photoshop. The problem your example demonstrates is not caused by the difference in blending modes. I'm attaching a filter doing the same task as your example, using the same blending mode and without pink tint. To understand where the problem comes from, try to adjust the RGB values of the Outer Frame color in the Frame component -- but don't change the alpha, this is essential. In short, Filter Forge's Set Alpha doesn't affect the RGB channels, so the pink is preserved even in 100% transparent areas -- that's why you're seeing it in the final image. As for the correctness of our blending modes, this has been discussed in countless threads on these forums, and I don't think that we've found a single difference (besides of course the HSY-based modes such as Color etc). No Pink Tint.ffxml |
|||
Posted: December 4, 2007 9:13 am | ||||
Sphinx.
![]() |
As in.. the different blendmodes doesn't have special alpha blending..only special color channel combining (well, maybe "dissolve".. but that mode is fundamentally different) |
|||
Posted: December 4, 2007 9:14 am | ||||
Vladimir Golovin
Administrator |
||||
Posted: December 4, 2007 9:17 am | ||||
Sphinx.
![]() |
Vlad, you miss my point.. In your "No Pink Tint" example you are mixing a white tint into the result image instead! This doesn't happen in Photoshop. Under no circumstances can zero alpha areas of the background become visible after blending.. makes no sense. Its a good question what actually should happen with a given blendmode for these areas. In photoshop it seems like they simply pass on the foreground unaffected by the blendmode for areas where background alpha is zero. I.e. the specific blendmode combining happens prior to the actual blending, and the result of the blendmode operation is then mixed with the foreground given by the background alpha it seems (I don't know... it just seems like that). Then after this, the normal blending takes place. I'd be happy to give you some pseudocode if you acknowledge the problem (I have a working example running in delphi now... had to check it out ![]() |
|||
Posted: December 4, 2007 9:37 am | ||||
Vladimir Golovin
Administrator |
Ok, I'll forward this to the programmer who did the blend modes -- we'll look into it.
|
|||
Posted: December 4, 2007 9:47 am | ||||
Sphinx.
![]() |
Cool
![]() Don't hesitate to bug me if you want further details. |
|||
Posted: December 4, 2007 9:58 am | ||||
Sphinx.
![]() |
||||
Posted: December 4, 2007 10:36 am | ||||
Kraellin
![]() |
psp works the same way. nothing is passed along the alpha except the alpha, blend modes inclusive. it is treated EXACTLY as a separate channel that has to be manipulated as its own channel all the way through. there are never any assumptions of the rgb being mixed in or passed through.
but i wouldnt put an 'alpha combine' as a slider within set alpha. i'd make it its own component. If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|||
Posted: December 4, 2007 1:39 pm | ||||
Sphinx.
![]() |
not a slider.. simply a checkbox that makes 'Set Alpha' multiply the new and current alpha channels.. Most filters that modifies input image alpha somehow, should do this (you never now what an image hides in its zero alpha areas..mostly weird noise) |
|||
Posted: December 4, 2007 3:02 pm | ||||
Mousewrites
![]() |
I see where Sphinx is coming from with the multiplied alpha, (Yeah, I know everyone else has moved on to blendmodes.
![]() If you think of a image with transparent as not having an alpha but being transparent, then set alpha should cut NEW holes in the image, not replace the old holes. I'd be FINE with this being a separate component, but it's anoying in that situation to have to put a get alpha, blend (to blend the old alpha and the new one) and then another set alpha. I want it to work like Sphinx wants it to work. Of course, once we have 'groups' I'll just make a 'whack new holes in this image' group. ![]() |
|||
Posted: December 11, 2007 7:35 pm | ||||
Sphinx.
![]() |
Bump! Just wanted to let you know this bug is still present
![]() Background has zero alpha outside the pink square, thus it should not influence result, regardless of blending mode. ![]() |
|||
Posted: November 11, 2010 12:18 pm | ||||
Sphinx.
![]() |
And here is a lua script bug fix (I'm sure you'll get the idea..)
function get_sample(x, y) -- fetch inputs local O = get_sample_grayscale(x, y, OPACITY) local Ra, Ga, Ba, Aa = get_sample_map(x, y, FOREGROUND) local Rb, Gb, Bb, Ab = get_sample_map(x, y, BACKGROUND) -- blendmode callback Ro = Ra + (get_sample_grayscale(Ra, Rb, BLEND_MODE) - Ra) * Ab Go = Ga + (get_sample_grayscale(Ga, Gb, BLEND_MODE) - Ga) * Ab Bo = Ba + (get_sample_grayscale(Ba, Bb, BLEND_MODE) - Ba) * Ab -- combine foreground alpha and master opacity Aa = O * Aa -- blend individual channels local Ao = Aa + Ab * (1 - Aa) if Ao > 0 then local rAo = 1 / Ao Rb = Rb * Ab Gb = Gb * Ab Bb = Bb * Ab Ro = (Rb + (Ro - Rb) * Aa) * rAo Go = (Gb + (Go - Gb) * Aa) * rAo Bo = (Bb + (Bo - Bb) * Aa) * rAo return Ro, Go, Bo, Ao else --undefined, returning something that makes slightly sense in FF context: return Rb,Gb,Bb,Ab end end; |
|||
Posted: November 11, 2010 12:42 pm | ||||
Sphinx.
![]() |
I just verified my blending formula above. It works exactly like Photoshop. The problem is not your blending mode formulas them selves, but rather your main blending routine: it is not handling the opacity variable correctly, in particular intermediate opacity values > 0 .. < 1, which causes hidden colors to reappear. |
|||
Posted: November 14, 2010 3:51 am | ||||
Sphinx.
![]() |
Blend bug is still present. Zero alpha = zero influence, hence the following blend modes are visibly faulty:
Color Burn Linear Burn Color Dodge Linear Dodge Vivid Light Difference Attached is a screenshot of Vivid light blending issues. I do not believe that the fault is in the individual blend mode formulas, but rather that the problem is a more general alpha related issue (see my proposal above). ![]() |
|||
Posted: November 17, 2011 7:03 am | ||||
Sphinx.
![]() |
||||
Posted: November 17, 2011 7:04 am | ||||
Morgantao
![]() |
Yep, still here
![]() |
|||
Posted: February 1, 2012 2:09 am | ||||
SpaceRay
![]() |
Is the blend bug still active and not fixed ?
|
|||
Posted: July 17, 2012 12:44 am | ||||
SpaceRay
![]() |
Hello again, I wonder if this alpha blend mode problem/bug (or whatever) is still the same in FF 3.0.14 or in FF 4.0 beta 2.
Sorry that I have not tested it myself |
|||
Posted: November 24, 2013 12:22 am | ||||
Sphinx.
![]() |
As of V5.0001 this bug is still present. The solution were posted in Lua script above, so if you're very annoyed by the wrong blending, feel free to use that.
|
|||
Posted: December 15, 2014 2:27 am | ||||
Sphinx.
![]() |
5.006 still there.
|
|||
Posted: November 30, 2015 7:51 am | ||||
Sphinx.
![]() |
7.007 bug still there... I totally forgot its 10 year birthday
![]() |
|||
Posted: May 24, 2018 7:43 am | ||||
Sphinxmorpher
![]() |
8.004 bug still there (12 years+).
There is an easy fix (already posted) that brings FF up to Photoshop standards (tell me that you don't care and I'll stop reminding you). |
|||
Posted: April 9, 2019 3:50 am | ||||
Sphinx.
![]() |
V 10.001 still there.
Btw the algorithm I suggest is similar to the algorithm listed here: https://en.wikipedia.org/wiki/Alpha_co...a_blending |
|||
Posted: August 29, 2020 11:47 am | ||||
Rachel Duim
![]() |
+1 the need to keep the RGBA space intact is important in complex filters. There are workarounds but... but they all slow down the filter so... just saying.
Math meets art meets psychedelia. |
|||
Posted: August 29, 2020 2:42 pm |
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,531 Posts
+39 new in 30 days!
15,347 Topics
+72 new in year!
17 unregistered users.