https://github.com/jeziellago/android-image-kit
Open-source library for image processing in Android.
https://github.com/jeziellago/android-image-kit
android android-image-kit kotlin kotlin-android kotlin-library
Last synced: 7 months ago
JSON representation
Open-source library for image processing in Android.
- Host: GitHub
- URL: https://github.com/jeziellago/android-image-kit
- Owner: jeziellago
- License: apache-2.0
- Created: 2018-10-24T03:19:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-25T16:02:29.000Z (almost 7 years ago)
- Last Synced: 2025-02-05T11:17:32.574Z (8 months ago)
- Topics: android, android-image-kit, kotlin, kotlin-android, kotlin-library
- Language: Kotlin
- Homepage:
- Size: 251 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Image Kit [](https://travis-ci.org/jeziellago/android-image-kit) [](https://jitpack.io/#jeziellago/android-image-kit)
Open-source library for image processing in Android.- Image color space conversion
- Gaussian Blur Filter
- Bitmap to RGB Matrix
- Draw Text, Rect, Circle, Points### Add in your project
Step 1. Add the JitPack repository to your build file
- Add it in your root build.gradle at the end of repositories:
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
Step 2. Add the dependency:
```gradle
dependencies {
implementation 'com.github.jeziellago:android-image-kit:v0.1-alpha'
}
```
## Examples:
### RGB to Gray Scale
```kotlin
val grayImage = Image(rgbImage)
.convertToGray()
.toBitmap()
```### Bitmap to RGB Matrix
```kotlin
val rgb3dMatrix = Image(imageBitmap).convertToRGBMatrix()
```### Resize
```kotlin
val resizedBitmap = Image(imageBitmap)
.resize(newWidth = 200f, newHeight = 250f)
.toBitmap()
```### Reshape to 4D (used in machine learning)
```kotlin
val image4dArray = Image(imageBitmap).reshapeTo4D()
```### Gaussian Blur Filter
```kotlin
val gaussianBlurImage = GaussianBlur(context).apply(sourceImage)
```### Drawing Text
```kotlin
val bitmap = ImagePaint(sourceBitmap)
.drawText(text = "Draw text here",
textSize = 50f,
textColor = Color.WHITE,
positionX = 50f,
positionY = 200f)
.toBitmap()
```
### Drawing Points
```kotlin
val bitmap = ImagePaint(sampleImage)
.drawPoints(points = 10f, 20f, 30f, ...)
.toBitmap()
```### Drawing Rect
```kotlin
val bitmap = ImagePaint(sampleImage)
.drawRect(rect = rectObject)
.toBitmap()
```_This library is in working progress_. Contribute to new features!