Migrating density mask to code pile