Package-level declarations

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

Returns Bitmap Width And Height Presented as a Pair of two Int where pair.first is width and pair.second is height

Functions

Link copied to clipboard
fun BitmapFactory_decodeByteArraySized(array: ByteArray, reqWidth: Int, reqHeight: Int): Bitmap

Decodes an image byte array into a bitmap, sizing it down to be just bigger than reqWidth and reqHeight while retaining powers of 2 scaling.

Link copied to clipboard
fun Context.correctBitmapRotation(initialBitmap: Bitmap, inputUri: Uri): Bitmap?

Corrects the rotation of a bitmap based on the EXIF tags in the file as specified by the URI

Link copied to clipboard
Link copied to clipboard
fun Activity.createColoredBitmap(color: Int, width: Int, height: Int): Bitmap
Link copied to clipboard

Crop image easily.

Link copied to clipboard
fun Bitmap.cropCenterSquare(sideLength: Int? = null, filter: Boolean = true): Bitmap
Link copied to clipboard
fun Resources.decodeBitmap(resId: Int, options: BitmapFactory.Options? = null): Bitmap?
fun FileDescriptor.decodeBitmap(outPadding: Rect? = null, options: BitmapFactory.Options? = null): Bitmap?
fun InputStream.decodeBitmap(outPadding: Rect? = null, options: BitmapFactory.Options? = null): Bitmap?
fun ByteArray.decodeBitmap(offset: Int, length: Int, options: BitmapFactory.Options? = null): Bitmap?
Link copied to clipboard
fun downloadBitmap(imageUrl: String): Bitmap?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
operator fun Bitmap.get(x: Int, y: Int): Int

get Pixels from Bitmap Easily

Link copied to clipboard
fun Context.getUriForFile(filePath: String, authority: String): Uri?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Bitmap.overlay(overlay: Bitmap): Bitmap
Link copied to clipboard
Link copied to clipboard
fun Bitmap.resize(newWidth: Number, newHeight: Number): Bitmap

Resize Bitmap to specified height and width.

fun Bitmap.resize(width: Int, height: Int, mode: ResizeMode = ResizeMode.AUTOMATIC, isExcludeAlpha: Boolean = false): Bitmap
Link copied to clipboard
fun Bitmap.rotate(degrees: Int): Bitmap

Rotates a bitmap, creating a new bitmap. Beware of memory allocations.

Link copied to clipboard
fun Bitmap.rotateTo(angle: Float, recycle: Boolean = true): Bitmap

rotate a Bitmap with a ease

Link copied to clipboard
Link copied to clipboard

Mthod to save Bitmap to specified file path.

Link copied to clipboard
infix fun ImageView.set(bitmap: Bitmap)
infix fun ImageView.set(drawable: Drawable)
infix fun ImageView.set(ic: Icon)
infix fun ImageView.set(uri: Uri)
infix fun ImageView.set(@DrawableRes id: Int)

operator fun Bitmap.set(x: Int, y: Int, pixel: Int)

set Pixels to Bitmap Easily

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Greyscale the Image.

Link copied to clipboard
@RequiresApi(value = 26)
fun Bitmap.toIcon(): Icon
Link copied to clipboard
fun Bitmap.toInputStream(compressFormat: Bitmap.CompressFormat = Bitmap.CompressFormat.JPEG, quality: Int = 100): InputStream
Link copied to clipboard
fun Bitmap.toOutputStream(compressFormat: Bitmap.CompressFormat = Bitmap.CompressFormat.JPEG, quality: Int = 100): OutputStream
Link copied to clipboard
fun Bitmap.toRound(borderSize: Float = 0.0f, borderColor: Int = 0, recycle: Boolean = true): Bitmap

Makes the Bitmap Round with given params

Link copied to clipboard

fun Bitmap.toRoundCorner(radius: Float, borderSize: Float = 0.0f, @ColorInt borderColor: Int = 0, recycle: Boolean = true): Bitmap

Blend the Bitmap Corners to Round with Given radius