How to have only 2 colors displayed while the rest of the image becomes transparent?

B4rt

New Member
I'm trying to make an overlay for VALORANT observer mode and wanted to get the healthbars enlarged and in a different position. Unfortunately the area behind the actual healthbar becomes transparent, thus showing the game at that part of the screen.

What I want to do is to sort of reverse chroma key so only pure white and red (the colors of the healthbar, white when HP is high, red when low) appear while the rest is fully transparent so that the healthbar can go onto my overlay.

If anybody knows how to do this, some help would be appreciated!
 

konsolenritter

Active Member
Thats really demanding. To be spoken logically (i haven't programmed such yet) is that you could (in principle)

- double chroma-key (one regarding white, one for red) filters on two copies of the same source,
- logical OR-ing those two (to get a combined one),
- then inverse it (to get all other parts transparent), and finally
- apply it to the origin material.

The really odd thing and hurdle is the thing regarding the white parts. Cause white is no real color: White or grey are inherent portion/share of all other colors. So attempting to key out white parts will result in keying out parts of all other pixels, too.

So this is a stinker or real difficult task, i think. Maybe someone here gets another clue...
 
Last edited:

WBE

Member
Do these health bars have fixed dimensions and position? Then you could use an image mask filter.

Emask-example.png

This is an example of a mask image: only the white portions will be shown.
 
Top