Badge - Template the Picture

Is it possible to template the picture that’s shown for a badge item? I want to ‘shade’ the background when someone is away for example:

Bart_home vs Bart_away

Ideally, I’d want to just throw CSS over the top of it, but if necessary, I can make two pictures and then alter the picture that’s used. Thanks!