• Stars
    star
    286
  • Rank 139,339 (Top 3 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.6'
  // Use the GPU Filters 
  implementation 'jp.wasabeef.transformers:coil-gpu:1.0.6'
}
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.6'
  // Use the GPU Filters 
  implementation 'jp.wasabeef.transformers:glide-gpu:1.0.6'
}
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.6'
  // Use the GPU Filters 
  implementation 'jp.wasabeef.transformers:picasso-gpu:1.0.6'
}
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.6'
  // Use the GPU Filters 
  implementation 'jp.wasabeef.transformers:fresco-gpu:1.0.6'
}
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 :core:clean :core:build :core:publish
....
....

More Repositories

1

awesome-android-ui

A curated list of awesome Android UI/UX libraries
49,176
star
2

recyclerview-animators

An Android Animation library which easily add itemanimator to RecyclerView items.
Kotlin
11,457
star
3

glide-transformations

An Android transformation library providing a variety of image transformations for Glide.
Java
9,848
star
4

richeditor-android

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.
Java
6,198
star
5

Blurry

Blurry is an easy blur library for Android
Java
5,547
star
6

awesome-android-libraries

This is an alphabetical list of libraries for Android development, the majority being actively maintained.
5,495
star
7

picasso-transformations

An Android transformation library providing a variety of image transformations for Picasso
Java
1,692
star
8

flutter-architecture-blueprints

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.
Dart
1,589
star
9

Takt

Takt is Android library for measuring the FPS using Choreographer.
Java
1,137
star
10

fresco-processors

An Android image processor library providing a variety of image transformations for Fresco.
Java
896
star
11

awesome-android-tools

A curated list of awesome Android Tools.
335
star
12

flutter_use

Play Flutter Hooks.
Dart
196
star
13

kotlin-mvvm

Sample for MVVM using Kotlin
Kotlin
180
star
14

droid

A command-line tool for checking Android OS version history written by Rust.
Rust
114
star
15

composable-images

The Composable Images is a library providing Jetpack Compose wrapper for Glide, Picasso, and Coil.
Kotlin
107
star
16

android-RoundedTextureView

RoundedTextureView Sample
Java
51
star
17

flutter_ua_client_hints

Provide User-Agent Client Hints to a Flutter app.
Dart
41
star
18

compose-gap

Easily adding gaps inside such as Columns and Rows for Jetpack Compose.
Kotlin
36
star
19

gifflen-sample

Bitmap color reduction and GIF encoding
C++
31
star
20

flutter_hooks_test

Simple and complete Flutter hooks testing utilities that encourage good testing practices.
Dart
30
star
21

vagrant-kali-linux

Vagrant Boxes - Kali Linux
25
star
22

NavPlayground

This is a sample of Navigation component.
Kotlin
18
star
23

version_gen

The Dart code generator for your package versions. 🎯
Dart
15
star
24

dockerfiles

A collection of Dockerfiles
Shell
12
star
25

wasabeef.jp

Build a web site using the Flutter Web.
Dart
11
star
26

import-asdf-tool-versions-action

⚒️ Import .tool-versions of asdf to GitHub Actions workflows.
JavaScript
11
star
27

adball

Adb All devices command
11
star
28

java-code-style

IntelliJ IDEA code style settings for Wasabeef's Java and Android projects.
6
star
29

wasabeef

3
star
30

dotfiles

Vim Script
3
star