Patchy fix for transparency bug, planning to rewrite the method using pixel arrays instead.