Added elementary posterize function