Transformation¶
The landscapist-transformation
package offers a range of valuable image transformation plugins, including the blur effect.
To utilize these transformation supports, simply add the following dependency:
dependencies {
implementation "com.github.skydoves:landscapist-transformation:$version"
}
dependencies {
implementation("com.github.skydoves:landscapist-transformation:$version")
}
BlurTransformationPlugin¶
You can effortlessly implement the blur effect using the BlurTransformationPlugin
, as demonstrated below:
GlideImage(
component = rememberImageComponent {
+BlurTransformationPlugin(radius = 10) // between 0 to Int.MAX_VALUE.
},
..
)
CoilImage(
component = rememberImageComponent {
+BlurTransformationPlugin(radius = 10) // between 0 to Int.MAX_VALUE.
},
..
)
FrescoImage(
component = rememberImageComponent {
+BlurTransformationPlugin(radius = 10) // between 0 to Int.MAX_VALUE.
},
..
)
By incorporating the BlurTransformationPlugin
, you can easily add a captivating blur effect to your images, enhancing their visual appeal and creating a more dynamic and immersive user experience within your app. Adjust the blurRadius
parameter to achieve the desired level of blurriness for your images.
Note
Landscapist's blur transformation falls back onto a CPU-based implementation to support older API levels. So you don't need to worry about API compatibilities and performance issues.