use area.empty instead of manual checks, allocate palette in 8bit modes