Can't what you're describing just be done with bitplane modulos or is that too obvious?
EDIT: went and actually bothered to look at the description in the link kamelito posted... I see what you're getting at Codetapper that modulos alone won't cut it.
Last edited by pmc; 22 November 2011 at 22:50.
Reason: It was too obvious :D