Reversed (additive) tint for bitmaps?

I am a big fan of using tint() to custom color simple bitmaps but because it only works subtractively it needs white bitmaps. Is there any way to make black bitmaps (with transparency) white, without manually looping through all the pixels?

I’m not sure if this applies to tint, but

blendMode(ADDITIVE) 

might be what youre looking for.
PS: I have no idea if this will work, don’t have codea nearby to test

How about using blendMode(ADDITIVE), and perhaps drawing the sprite several times?

Check out the various solutions in this thread:

http://codea.io/talk/discussion/6249/coding-a-bitmap-to-flash-briefly

Additive blendmode won’t work because the bitmap is full black. However maybe I can use the blendmode(srcfact, dstfact, srcalpha, dstalpha) in some manner. Thanks for the suggestions!

@Jmv38 - any suggestions?

If you want to start drawing with alpha, use blendMode(ADDITIVE), if you want after opening the blendmode drawing normal use blendMode(NORMAL), and if you want to draw with many blends (very dark, big alpha value) use blendMode(MULTIPLY)

@Kirl what is the aim here, to make a completely black sprite turn grey? I would suggest that you should start with a white texture, because as you say, this gives you lots of latitude to play with, it can be tinted to any colour, including black.

Yes, I wanted to change a full black bitmap with transparency (from photos) to a full white bitmap while retaining the transparency. A trivial task with editing software, but it was an excellent excuse for more practise with the multi-argument blendmode. :slight_smile:

After the obligatory bit of fumbling, I did manage to get what I was after by making a new image with a white background and blending the black bitmap over it with: blendMode(DST_COLOR, SRC_ALPHA).

It always seems obvious in hindsight!

Thanks all!