Android library for native floyd steinberg dithering on bitmap

Overview

License

Native-Floyd-Steinberg-Dithering

Android library for floyd-steinberg dithering on bitmap using JNI/Cmake

Why FSD

For those who don't know the purpose of Floyd-Steinberg algorithm, it is a algorithm to turn color image to black and white(NOT GRAYSCALE).

When would we use this? Well, for those e-ink displays like Amazon Kindle, they can't display color images, and just black and white(see below) would still look bad, this is when this algorithm and library is usful.

I have tried using just java to run the algorithm, but it is slow. This library is small and easy to use. Ideally you should NOT run this not on the main thread.

Using FSD

Setup

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
Dependencies
	dependencies {
		implementation 'com.github.jeffreyliu8.Native-Floyd-Steinberg-Dithering:final:1.1.0'
	}

The last working version is compile 'com.github.jeffreyliu8:Native-Floyd-Steinberg-Dithering:1.0.3'. Notice the 2 version formats are different!

A quick example is shown below:

val original = BitmapFactory.decodeResource(resources, R.drawable.lena)
val fsBitmap = Utils().floydSteinbergDithering(original)

And for just black and white image:

val bwBitmap = Utils().binaryBlackAndWhite(original)

And for gray-scale image(This is just a simple java function):

val grayBitmap = Utils().toGrayscale(original)

Output sample

Requirements

Requires a minimum SDK version of 16 (14 should still work)

You might also like...
Initiate immediate phone call for React Native on iOS and Android.

react-native-immediate-call-library Initiate immediate phone call for React Native on iOS and Android. Getting started Using npm: npm install react-na

Clothes shop native android app
Clothes shop native android app

ShopApp I built this clothes shop native android app in which I tried to implement clean architecture principles and use Jetpack Compose to create the

A 2020s compatible React Native keyboard avoiding view for Android and iOS that just works.

react-native-keyboard-shift Example Snack coming soon Until then: Clone this repo: git clone https://github.com/FullStackCraft/react-native-keyboard-s

Inspection tools for native android apps
Inspection tools for native android apps

InspectElement This project was just an exercise based on Android Developer Assistant, I have used AccessibilityService for inspecting, You can change

ShopApp - A Native Android Shop app with kotlin
ShopApp - A Native Android Shop app with kotlin

A Native Android Shop app. Light Theme Dark Theme I've used: Kotlin The MVVM architecture pattern Jetpack Compose Hilt for dependency injectio

Native android application that scans for text in images. Uses ML kit under the hood.
Native android application that scans for text in images. Uses ML kit under the hood.

Scannerate - Ad free Text Recognition Android application built using Kotlin to extract text from images. Uses Google's ML kit library under the hood.

 ⚡️ A supercharged native Web View for iOS and Android ⚡️
⚡️ A supercharged native Web View for iOS and Android ⚡️

⚡️ A supercharged native Web View for iOS and Android ⚡️ Ionic Portals is a supercharged native Web View component for iOS and Android that lets you a

Third-party native Jellyfin Android app
Third-party native Jellyfin Android app

Findroid Findroid is third-party Android application for Jellyfin that provides a native user interface to browse and play movies and series. I am dev

A demo for Android font typeface support in React Native!
A demo for Android font typeface support in React Native!

A Step-by-step Guide to a Consistent Multi-Platform Font Typeface Experience in React Native Goal Be able to use font typeface modifiers such as fontW

Releases(1.1.5)
Owner
Jeffrey Liu
Jeffrey Liu
A Python native extension written in Kotlin Native

Kotlin Python Ext This is a proof of concept for a Python extension in Kotlin. It is recommended to read the Official Python C API Documentation befor

Martmists 20 Jun 22, 2022
Native-loader - Safely load native libraries in Java

Native Loader ??️ Safe native loading in Java based off of the native-loader use

Mixtape 1 Oct 19, 2022
React-native-user-interface - Change React Native userinterface at runtime

react-native-user-interface change RN userinterface at runtime. Installation npm

Ahmed Eid 0 Jan 11, 2022
A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library.

Expo Music Picker A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library. Supp

Bartłomiej Klocek 60 Dec 29, 2022
Android native news App using API from thenewsapi.com and Retrofit Library

FlashBytes-Android-News-App Android Material Design News App using API from https://www.thenewsapi.com/ and Retrofit Library Screen Splash, Onboard Sc

claudysoft 4 Nov 11, 2022
Library to read incoming SMS in Android for Expo (React Native)

react-native-expo-read-sms Maintainers maniac-tech Active maintainer Installation Install this in your managed Expo project by running this command: $

Abhishek Jain 15 Jan 2, 2023
Bindings to the JNI library on Android for Kotlin/Native

JNI Utils using this library: implementation("io.github.landrynorris:jni-utils:0.0.1-alpha01") This library provides bindings to the JNI library on An

Landry Norris 6 Sep 27, 2022
Simple library to decompress files .zip, .rar, .cbz, .cbr in React Native.

Uncompress React Native Simple library to decompress files .zip, .rar, .cbz and .cbr in React Native. Installation yarn add uncompress-react-native o

Adriano Souza Costa 40 Nov 24, 2022
A Kotlin binding to webview, a tiny cross-platform webview library, supports Java and Native.

webviewko provides a Kotlin/JVM and a Kotlin/Native(experimental) binding to webview, a tiny cross-platform webview library to build modern cross-platform GUIs using WebView2, WebKit and WebKitGTK.

Winterreisender 17 Dec 30, 2022
🌄 Photo editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and PhotoEditor (Android)

React Native Photo Editor (RNPE) ?? Image editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and Ph

Baron Ha. 242 Dec 28, 2022