optimize Image
fun optimizeImage(bitmap: Bitmap, widthInches: Float, heightInches: Float, maxRequiredDpi: Long): Bitmap
Scales image to desirable quality.
Return
optimized (scaled down) Bitmap. If quality of source image will be less than maxRequiredDpi, then original Bitmap will be returned
Parameters
bitmap
you want to optimize
width Inches
suppositious physical width
height Inches
suppositious physical height
max Required Dpi
desirable quality
Scales image to desirable quality.
Return
optimized (scaled down) {@Bitmap}. If quality of source image will be less than requiredDpi, then original {@Bitmap} will be returned
Parameters
bitmap
you want to optimize
required Dpi
desirable quality