An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.

Overview

What is Transformers?

An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.


Part of the sample


Glide Transformations, Picasso Transformations, Fresco Processors are deprecated.
Development will stop soon.. For an up-to-date version, please use this.

Installation

Requirements

  • Android 5.0+ Lollipop (API level 21)

Gradle settings

repositories {
  mavenCentral()
}

This Transformer is NOT using android.support.v8.rendererscript because librs.so make the APK file too big.

For Coil

dependencies {
  implementation 'jp.wasabeef.transformers:coil:1.0.3'
  // Use the GPU Filters 
  implementation 'jp.wasabeef.transformers:coil-gpu:1.0.3'
}
imageView.load(IMAGE_URL) {
  transformations(
    CropCenterTransformation(),
    RoundedCornersTransformation(radius = 120, cornerType = CornerType.DIAGONAL_FROM_TOP_LEFT)
  )
}

For Glide

dependencies {
  implementation 'jp.wasabeef.transformers:glide:1.0.3'
  // Use the GPU Filters 
  implementation 'jp.wasabeef.transformers:glide-gpu:1.0.3'
}
Glide.with(context)
  .load(IMAGE_URL)
  .apply(
    bitmapTransform(
      MultiTransformation(
        CropCenterTransformation(),
        BlurTransformation(context, 15, sampling = 1)
      )
    )
  ).into(imageView)

For Picasso

dependencies {
  implementation 'jp.wasabeef.transformers:picasso:1.0.3'
  // Use the GPU Filters 
  implementation 'jp.wasabeef.transformers:picasso-gpu:1.0.3'
}
Picasso.get()
  .load(IMAGE_URL)
  .fit().centerInside()
  .transform(
    mutableListOf(
      CropCenterTransformation(),
      BlurTransformation(context, 25, sampling = 4)
    )
  ).into(imageView)

For Fresco

dependencies {
  implementation 'jp.wasabeef.transformers:fresco:1.0.3'
  // Use the GPU Filters 
  implementation 'jp.wasabeef.transformers:fresco-gpu:1.0.3'
}
val request: ImageRequest =
  ImageRequestBuilder.newBuilderWithSource(IMAGE_URL.toUri())
  .setPostprocessor(BlurPostprocessor(context, 25, 4))
  .build()

holder.image.controller = Fresco.newDraweeControllerBuilder()
  .setImageRequest(request)
  .setOldController(draweeView.controller)
  .build()

With Jetpack Compose

Use Composable Images when using with Jetpack Compose.

GlideImage(
  model = IMAGE_URL,
  modifier = Modifier.preferredWidth(120.dp),
  options = RequestOptions().transform(
    BlurTransformation(context, radius = 25, sampling = 4)
  )
)

Sample transformations

Original Mask NinePatchMask CropTop
CropCenter CropBottom CropCenterRatio16x9 CropCenterRatio4x3
CropTopRatio16x9 CropBottomRatio4x3 CropSquare CropCircle
CropCircleWithBorder ColorFilter Grayscale RoundedCorners
RoundedCornersTopLeft RSGaussianBlurLight RSGaussianBlurDeep StackBlurLight
StackBlurDeep

coil, glide, picasso

  • BlurTransformation
  • ColorFilterTransformation
  • CropCenterBottomTransformation
  • CropCenterTopTransformation
  • CropCenterTransformation
  • CropCircleTransformation
  • CropCircleWithBorderTransformation
  • CropSquareTransformation
  • CropTransformation
  • GrayscaleTransformation
  • MaskTransformation
  • RoundedCornersTransformation

fresco

  • BlurPostprocessor
  • ColorFilterPostprocessor
  • CombinePostProcessors
  • GrayscalePostprocessor
  • MaskPostprocessor

Sample transformations with GPUImage

We recommend that you have a ToneCurve file, as you can apply any filters you like.

Original Sepia Contrast Invert
PixelLight PixelDeep Sketch Swirl
Brightness Kuawahara Vignette ZoomBlur
WhiteBalance Halftone Sharpness Toon
ToneCurve

coil-gpu, glide-gpu, picasso-gpu

  • BrightnessFilterTransformation
  • ContrastFilterTransformation
  • HalftoneFilterTransformation
  • InvertFilterTransformation
  • KuwaharaFilterTransformation
  • PixelationFilterTransformation
  • SepiaFilterTransformation
  • SharpenFilterTransformation
  • SketchFilterTransformation
  • SwirlFilterTransformation
  • ToneCurveFilterTransformation
  • ToonFilterTransformation
  • VignetteFilterTransformation
  • WhiteBalanceFilterTransformation
  • ZoomBlurFilterTransformation

fresco-gpu

  • BrightnessFilterPostprocessor
  • ContrastFilterPostprocessor
  • HalftoneFilterPostprocessor
  • InvertFilterPostprocessor
  • KuwaharaFilterPostprocessor
  • PixelationFilterPostprocessor
  • SepiaFilterPostprocessor
  • SharpenFilterPostprocessor
  • SketchFilterPostprocessor
  • SwirlFilterPostprocessor
  • ToneCurveFilterPostprocessor
  • ToonFilterPostprocessor
  • VignetteFilterPostprocessor
  • WhiteBalanceFilterPostprocessor
  • ZoomBlurFilterPostprocessor

Development

Setup

Things you will need

$ npm install

Build

$ ./gradlew assemble

Formatting

$ ./gradlew ktlint

Publishing to Maven Central

$ ./gradlew clean build publish
You might also like...
Image Cropping Library for Android, optimised for Camera / Gallery.
Image Cropping Library for Android, optimised for Camera / Gallery.

Image Cropping Library for Android, optimised for Camera / Gallery.

An image loading library for android.

Bilder Download Add following to your project's build.gradle allprojects { repositories { ... maven { url 'https://jitpack.io' } } }

🎨 Modern image loading library for Android. Simple by design, powerful under the hood.
🎨 Modern image loading library for Android. Simple by design, powerful under the hood.

Simple Image Loader Modern image loading library for Android. Simple by design, powerful under the hood. Kotlin: Simple Image Loader is Kotlin-native

Image Cropping Library for Android
Image Cropping Library for Android

Image Cropping Library for Android

A small customizable library useful to handle an gallery image pick action built-in your app. :sunrise_over_mountains::stars:
A small customizable library useful to handle an gallery image pick action built-in your app. :sunrise_over_mountains::stars:

Louvre A small customizable image picker. Useful to handle an gallery image pick action built-in your app. *Images from Google Image Search Installati

RoundedImageView-Library 0.9 0.0 Java To set single or multiple corners on Image Views.
RoundedImageView-Library 0.9 0.0 Java To set single or multiple corners on Image Views.

RoundedImageView-Library Rounded ImageView Android Library, to set single or multiple corners on imageview. Screenshot Usage Step 1. Add the JitPack r

A library for image manipulation with power of renderScript which is faster than other ordinary solutions.
A library for image manipulation with power of renderScript which is faster than other ordinary solutions.

Pixl is a library for image manipulation with power of renderScript which is faster than other ordinary solutions, currently it includes three basic scripts, brightness, contrast, saturation.

Image cropping library written with Jetpack Compose with other Composables such as ImageWithConstraints scales Bitmap

Image cropping library written with Jetpack Compose with other Composables such as ImageWithConstraints scales Bitmap it displays and returns position and bounds of Bitmap and ImageWithThumbnail to display thumbnail of the image on selected corner.

Android widget for cropping and rotating an image.
Android widget for cropping and rotating an image.

Cropper The Cropper is an image cropping tool. It provides a way to set an image in XML and programmatically, and displays a resizable crop window on

Comments
  • Transformer is not compatible with coil 2.0

    Transformer is not compatible with coil 2.0

    Coil will make a big breaking change in 2.0. Now, many Transformation for Coil, including BlurTransformation, throw an AbstractMethodError and do not work with Coil 2.0.

    At least the following two changes are required.

    • Transformation.key is replaced withTransformation.cacheKey.
    • BitmapPool andPoolableViewTarget have been removed from the library.

    Since Coil 2.0 is alpha, it may changes until the stable release.

    Can I make a Pull Request?

    opened by Mori-Atsushi 2
  • Update coil 2.0.0-rc01

    Update coil 2.0.0-rc01

    fix #7

    What does this change?

    Update coil 2.0.0-rc01 and fix to build.

    • Transformation.key is replaced with Transformation.cacheKey.
    • BitmapPool and PoolableViewTarget have been removed from the library.
    • Update compileSdk/targetSdk 31

    By using SDK 31, renderscript is deprecated. Therefore, I temporarily excluded the allWarningsAsErrors setting.

    opened by Mori-Atsushi 1
  • Problems encountered using glide transformation

    Problems encountered using glide transformation

    Thank you for the glide transformation library, I encountered a tough problem when using the glide blur transformation method, if you have time, can you tell me what is the reason...Thanks a million!!

    Here is the stack trace:

    11-30 19:29:17.687: A/DEBUG(20661): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    11-30 19:29:17.687: A/DEBUG(20661): Build fingerprint: 'google/redfin_64/redfin:13/TP1A.220624.014/8819323:userdebug/dev-keys'
    11-30 19:29:17.687: A/DEBUG(20661): Revision: 'MP1.0'
    11-30 19:29:17.687: A/DEBUG(20661): ABI: 'arm64'
    11-30 19:29:17.687: A/DEBUG(20661): Timestamp: 2022-11-30 19:29:16.492229176-0800
    11-30 19:29:17.687: A/DEBUG(20661): Process uptime: 9s
    11-30 19:29:17.688: A/DEBUG(20661): Cmdline: xxxx.xxxx.xxxx
    11-30 19:29:17.688: A/DEBUG(20661): pid: 19825, tid: 20637, name: glide-source-th  >>> xxxx.xxxx.xxxx <<<
    11-30 19:29:17.688: A/DEBUG(20661): uid: 10264
    11-30 19:29:17.688: A/DEBUG(20661): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000
    11-30 19:29:17.688: A/DEBUG(20661): Cause: null pointer dereference
    11-30 19:29:17.688: A/DEBUG(20661):     x0  0000000000000000  x1  0000000000000000  x2  00000070171132c4  x3  0000000000000004
    11-30 19:29:17.688: A/DEBUG(20661):     x4  0000000000000004  x5  0000000000000000  x6  ff7b7070ff7b7070  x7  ff7b706fff7b7070
    11-30 19:29:17.688: A/DEBUG(20661):     x8  0000006f6622b53c  x9  a834832689f6064a  x10 0000000000000000  x11 0000000000000665
    11-30 19:29:17.688: A/DEBUG(20661):     x12 0000000080d95f72  x13 ff7b706fff7b7070  x14 0000000000000001  x15 b4000070157b7044
    11-30 19:29:17.688: A/DEBUG(20661):     x16 0000006f67ba9c40  x17 0000006f67b99fe4  x18 0000007016f3c000  x19 0000007017114000
    11-30 19:29:17.688: A/DEBUG(20661):     x20 b4000071acedc6c0  x21 b4000071acedcc20  x22 0000007017113318  x23 b4000071acedcc50
    11-30 19:29:17.688: A/DEBUG(20661):     x24 0000000000000001  x25 00000000ffffffff  x26 0000000000000000  x27 0000000000000008
    11-30 19:29:17.688: A/DEBUG(20661):     x28 0000006f67baaea0  x29 00000070171132d0
    11-30 19:29:17.688: A/DEBUG(20661):     lr  0000006f67b9a02c  sp  00000070171132c0  pc  0000006f6622b54c  pst 0000000020000000
    11-30 19:29:17.688: A/DEBUG(20661): backtrace:
    11-30 19:29:17.688: A/DEBUG(20661):       #00 pc 000000000001e54c  /apex/com.android.vndk.v33/lib64/libRSDriver.so (rsdScriptSetGlobalVar(android::renderscript::Context const*, android::renderscript::Script const*, unsigned int, void*, unsigned long)+16) (BuildId: cfdd713285af66dd4339fd9a98e84678)
    11-30 19:29:17.688: A/DEBUG(20661):       #01 pc 000000000003c028  /apex/com.android.vndk.v33/lib64/libRS_internal.so (android::renderscript::rsi_ScriptSetVarF(android::renderscript::Context*, void*, unsigned int, float)+68) (BuildId: e5e4d6e722fa1a66ebc31128336a8992)
    11-30 19:29:17.688: A/DEBUG(20661):       #02 pc 00000000000427ac  /apex/com.android.vndk.v33/lib64/libRS_internal.so (android::renderscript::ThreadIO::playCoreCommands(android::renderscript::Context*, int)+364) (BuildId: e5e4d6e722fa1a66ebc31128336a8992)
    11-30 19:29:17.688: A/DEBUG(20661):       #03 pc 000000000002c47c  /apex/com.android.vndk.v33/lib64/libRS_internal.so (android::renderscript::Context::threadProc(void*)+2340) (BuildId: e5e4d6e722fa1a66ebc31128336a8992)
    11-30 19:29:17.688: I/A(5937): #shareData for GellerAiAiDataShare_shareData_GELLER_CONFIG with pending task count: 0
    11-30 19:29:17.688: A/DEBUG(20661):       #04 pc 00000000000b62b8  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: 058e3ec96fa600fb840a6a6956c6b64e)
    11-30 19:29:17.688: A/DEBUG(20661):       #05 pc 0000000000052fb8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 058e3ec96fa600fb840a6a6956c6b64e)
    
    
    opened by ihgoo 0
Releases(v1.0.6)
Owner
Daichi Furiya
Google Developers Expert for Android
Daichi Furiya
Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures. Made by Stfalcon

This project is no longer supported. If you're able to switch from Fresco to any other library that works with the Android's ImageView, please migrate

Stfalcon LLC 1.8k Dec 19, 2022
Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image selection.

Awesome Image Picker Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image sel

Prabhakar Thota 162 Sep 13, 2022
This is an Image slider with swipes, Here we used Volley to Image load URL's from JSON! Here we make it very easy way to load images from Internet and We customized the description font style(OpenSans).

ImageSliderWithSwipes This is an Image slider with swipes, Here we used Volley to load URL's from JSON! Here we make it very easy way to load images f

Prabhakar Thota 44 May 31, 2021
Library to save image locally and shows options to open and share !

Image Save and Share Library to save image locally and shows options to open and share ! Download Demo APK from HERE Kindly use the following links to

Prabhakar Thota 27 Apr 18, 2022
Dali is an image blur library for Android. It contains several modules for static blurring, live blurring and animations.

Dali Dali is an image blur library for Android. It is easy to use, fast and extensible. Dali contains several modules for either static blurring, live

Patrick Favre-Bulle 1k Dec 1, 2022
An android image compression library.

Compressor Compressor is a lightweight and powerful android image compression library. Compressor will allow you to compress large photos into smaller

Zetra 6.7k Dec 31, 2022
A simple image cropping library for Android.

SimpleCropView The SimpleCropView is an image cropping library for Android. It simplifies your code for cropping image and provides an easily customiz

Issei Aoki 2.5k Dec 28, 2022
An image resizing library for Android

Resizer Inspired by zetbaitsu's Compressor, Resizer is a lightweight and easy-to-use Android library for image scaling. It allows you to resize an ima

Kakit Ho 426 Dec 22, 2022
Simple android image popup Library

Android Image Popup Show image as a popup on a click event or any event. Simply set the image as drawable and thats it!!!. And also you can set width,

Chathura Lakmal 64 Nov 15, 2022
Image loading library for Android

Image Loader Image loader library for Android. Deprecated. See Glide. Features Image transformations Automatic memory and storage caching Ability to l

Yuriy Budiyev 19 May 28, 2022