blur

suspend fun Drawable.blur(context: Context, @Px blurRadiusPx: Float, samplingMultiplier: Float = DEFAULT_SAMPLING_MULTIPLIER): Drawable

Creates a blurred version of a drawable.

The drawable will up- or downscaled by samplingMultiplier. Values greater than 1 will downscale the image while values between 0 and 1 will upscale the image. Downscaling is recommended for large images with strong blur to improve performance, while upscaling can be used for creating images that are look good even when presented in a larger view. Once the image is scaled, a Gaussian blur with blurRadiusPx is applied. Keep in mind that because the blur is applied after the scaling, the samplingMultiplier impacts the amount of blurring if the resulting image is shown with a fixed size.