filter.chromaKey not working?!

I tried the filter.chromaKey, which would be a super handy tool, but all it does for me is either making the image disappear totally or filtering it very weirdly… also it seems, that it doesnt matter if I put {0,0,0,1} or {1,1,1,1} in the filter color it always tries to key the white…

any suggestions?

can we get a fix on that?

cheers

Phil

Can you post your code?

local img = display.newImage( filePath )

img.fill.effect = ‘filter.chromaKey’

img.fill.effect.sensitivity = 0.01

img.fill.effect.smoothing = 0.01

img.fill.effect.color = { 1, 1, 1, 1 }

I tried a lot of different values for sensitivity, smoothing and color. It seems that sensitivity has to be a very very tiny value and color gets ignored when {1,1,1,1} or {0,0,0,1}

cheers,

Phil

using build : Version 2015.2565 (2015.2.21)

Hey Phil, this seems to be working for me… sort of.  The idea behind ChromaKey is to knock one specific color out of the image.  I built an image that had 1/4 all red, 1/4 all green, 1/4 all blue and 1/4 all white.  When I pick a color like { 1, 0, 0 } it knocks out the red as expected.  If I do { 0, 1, 0} it kills the green.  If I do { 1, 1, 0}  nothing gets knocked out because there is no yellow. 

The oddity is with grey colors, setting 0, 0, 0 or 1, 1, 1 kills any gray tone.

ok. so is there any chance we will be seeing a lumaKey in the future then, if the chromaKey is not meant to key black or white?

You would need to request it at But we also have opened up the ability to make your own shaders.  Look at this blog post:  https://coronalabs.com/blog/2015/04/15/custom-shader-effects/

There are probably code out there that you could use to build the kernel and fragment pieces needed.  This forum thread might be of use too:  https://forums.coronalabs.com/topic/56284-share-your-shaders/

Rob

Can you post your code?

local img = display.newImage( filePath )

img.fill.effect = ‘filter.chromaKey’

img.fill.effect.sensitivity = 0.01

img.fill.effect.smoothing = 0.01

img.fill.effect.color = { 1, 1, 1, 1 }

I tried a lot of different values for sensitivity, smoothing and color. It seems that sensitivity has to be a very very tiny value and color gets ignored when {1,1,1,1} or {0,0,0,1}

cheers,

Phil

using build : Version 2015.2565 (2015.2.21)

Hey Phil, this seems to be working for me… sort of.  The idea behind ChromaKey is to knock one specific color out of the image.  I built an image that had 1/4 all red, 1/4 all green, 1/4 all blue and 1/4 all white.  When I pick a color like { 1, 0, 0 } it knocks out the red as expected.  If I do { 0, 1, 0} it kills the green.  If I do { 1, 1, 0}  nothing gets knocked out because there is no yellow. 

The oddity is with grey colors, setting 0, 0, 0 or 1, 1, 1 kills any gray tone.

ok. so is there any chance we will be seeing a lumaKey in the future then, if the chromaKey is not meant to key black or white?

You would need to request it at But we also have opened up the ability to make your own shaders.  Look at this blog post:  https://coronalabs.com/blog/2015/04/15/custom-shader-effects/

There are probably code out there that you could use to build the kernel and fragment pieces needed.  This forum thread might be of use too:  https://forums.coronalabs.com/topic/56284-share-your-shaders/

Rob