> ## Documentation Index
> Fetch the complete documentation index at: https://filekit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Krop

> Crop images picked with FileKit using the Krop library

[Krop](https://github.com/tamimattafi/krop) is a third-party image cropping library for Compose Multiplatform. Its FileKit extension turns a `PlatformFile` into a Krop image source.

![Krop cropping an image](https://raw.githubusercontent.com/tamimattafi/krop/refs/heads/main/art/preview.gif)

## Usage

Add the Krop cropper UI and its FileKit extension:

```kotlin build.gradle.kts theme={null}
implementation("com.attafitamim.krop:ui:<version>")
implementation("com.attafitamim.krop:extensions-filekit:<version>")
```

Pick an image with FileKit, then hand it to Krop with `toImageSrc()`:

```kotlin theme={null}
scope.launch {
    val file = FileKit.openFilePicker(type = FileKitType.Image) ?: return@launch
    val imageSrc = file.toImageSrc()
    // Pass imageSrc to Krop's image cropper
}
```

See the [Krop README](https://github.com/tamimattafi/krop) for the cropper setup, supported platforms, and the current version. Once cropped, save the result with the [file saver](https://filekit.mintlify.site/dialogs/file-saver.md) or [compress it](https://filekit.mintlify.site/core/image-and-video-utils.md) first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.