local entropy calculation and image creation