A GD2 method for smart resizing and cropping, based on entropy and color of the image