Package-level declarations
Types
Link copied to clipboard
Output format used during compression.
Link copied to clipboard
data class ImageCompressionOptions(val format: ImageCompressionFormat = ImageCompressionFormat.JPEG, val quality: Int = 90, val maxBytes: Long? = null, val minQuality: Int = 55, val qualityStep: Int = 5)
Options that control image compression.
Functions
Link copied to clipboard
expect fun ByteArray.compressImage(options: ImageCompressionOptions = ImageCompressionOptions()): ByteArray
Compresses this ByteArray if it contains a supported image.
Link copied to clipboard
fun ImageData.compressToMaxBytes(maxBytes: Long, format: ImageCompressionFormat = ImageCompressionFormat.JPEG, quality: Int = 90, minQuality: Int = 55, qualityStep: Int = 5): ImageData
Compresses this ImageData toward the provided maximum size.
fun ByteArray.compressToMaxBytes(maxBytes: Long, format: ImageCompressionFormat = ImageCompressionFormat.JPEG, quality: Int = 90, minQuality: Int = 55, qualityStep: Int = 5): ByteArray
Compresses this ByteArray toward the provided maximum size.
Link copied to clipboard
actual suspend fun ByteArray.downSamplingToImageBitmap(coroutineScope: CoroutineScope, reqHeight: Int, reqWidth: Int): ImageBitmap?
expect suspend fun ByteArray.downSamplingToImageBitmap(coroutineScope: CoroutineScope, reqHeight: Int, reqWidth: Int): ImageBitmap?
Returns a bitmap with down sampling for the current screen size.
actual suspend fun ByteArray.downSamplingToImageBitmap(coroutineScope: CoroutineScope, reqHeight: Int, reqWidth: Int): ImageBitmap?
actual suspend fun ByteArray.downSamplingToImageBitmap(coroutineScope: CoroutineScope, reqHeight: Int, reqWidth: Int): ImageBitmap?
Link copied to clipboard
Link copied to clipboard
Opens the platform's image picker and returns the selected ImageData, or null if the user cancels the selection.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun ImageBitmap.withAspectRatio(aspectRatio: Float, scale: Boolean = false, targetHeight: Int? = null): ImageBitmap
Adjusts this ImageBitmap to a target aspect ratio.