[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7475":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":42,"readmeContent":43,"aiSummary":44,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":45,"discoverSource":46},7475,"sketch","panpf\u002Fsketch","panpf","Sketch is an image loading library designed for Compose Multiplatform and Android View. It is powerful and rich in functions. In addition to basic functions, it also supports GIF, SVG, video thumbnails, Exif Orientation, etc.","https:\u002F\u002Fpanpf.github.io\u002Fsketch\u002F",null,"Kotlin",2390,322,50,4,0,2,8,1,29.53,"Apache License 2.0",false,"main",true,[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"android","apk-icon","base64-image","compose","compose-multiplatform","exif","gif","heif","image","image-loader","image-orientation","jetpack-compose","okhttp","svg","video-thumbnail","webp","2026-06-12 02:01:40","# ![logo_image] Sketch Image Loader\n\n![Platform][platform_image]\n[![License][license_image]][license_link]\n[![version_icon]][version_link]\n![QQ Group][qq_group_image]\n\nTranslations: [简体中文](README.zh.md)\n\nSketch is an image loading library specially designed for Compose Multiplatform and Android View. It\nhas the following features:\n\n* `Multiple sources`: Supports loading images from multiple sources such as http, file,\n  compose resource, android asset\u002Fcontent\u002Fresource, etc.\n* `Powerful functions`: Supports three-level caching, automatically cancels requests, automatically\n  adjusts image size, automatically rotates images according to Exif Orientation, etc.\n* `Rich functions`: Supports Animated image, SVG images, Base64 images, and video frames\n* `Easy to expand`: Supports expansion of various aspects such as caching, decoding, transformation,\n  transition, placeholder, etc.\n* `Extended functions`: Practical extensions such as pausing downloads when cellular data is\n  provided, pausing loading during list scrolling, image type badges, download progress indicators,\n  etc.\n* `Modern`: Completely based on Kotlin and Kotlin coroutine design\n\n## Sample App\n\n* For Android, iOS, desktop version, and web deployable packages, please go to\n  the [Releases](https:\u002F\u002Fgithub.com\u002Fpanpf\u002Fsketch\u002Freleases) page to download.\n* Web example：https:\u002F\u002Fpanpf.github.io\u002Fsketch\u002Fapp\n\n## Install\n\n`Published to mavenCentral`\n\n`${LAST_VERSION}`: [![Download][version_icon]][version_link] (Not included 'v')\n\n### Compose Multiplatform:\n\nImport the required Compose and network modules:\n\n```kotlin\n\u002F\u002F Provides the core functions of Sketch as well as singletons and extension \n\u002F\u002F functions that rely on singleton implementations\nimplementation(\"io.github.panpf.sketch4:sketch-compose:${LAST_VERSION}\")\n\n\u002F\u002F Provides the ability to load network images\nimplementation(\"io.github.panpf.sketch4:sketch-http:${LAST_VERSION}\")\n```\n\n> [!IMPORTANT]\n> To improve the performance of compose, please copy [compose_compiler_config.conf] under\n> the `sketch-core` module file to your project and configure it according to\n> the [Compose Stability Configuration][stability_configuration] documentation\n\n### Android View:\n\nImport the required View and network modules:\n\n```kotlin\n\u002F\u002F Provides the core functions of Sketch as well as singletons and extension \n\u002F\u002F functions that rely on singleton implementations\nimplementation(\"io.github.panpf.sketch4:sketch-view:${LAST_VERSION}\")\n\n\u002F\u002F Provides the ability to load network images\nimplementation(\"io.github.panpf.sketch4:sketch-http:${LAST_VERSION}\")\n```\n\n### Optional modules:\n\n```kotlin\n\u002F\u002F Use Android or Skia's built-in decoder to decode gif animations and play them\nimplementation(\"io.github.panpf.sketch4:sketch-animated-gif:${LAST_VERSION}\")\n\n\u002F\u002F [Android only] Use the GifDrawable of the android-gif-drawable library to decode and play gif animations\nimplementation(\"io.github.panpf.sketch4:sketch-animated-gif-koral:${LAST_VERSION}\")\n\n\u002F\u002F [Android only] Android or Skia's built-in decoder decodes heif animations and plays them\nimplementation(\"io.github.panpf.sketch4:sketch-animated-heif:${LAST_VERSION}\")\n\n\u002F\u002F Use Android or Skia's built-in decoder to decode webp animations and play them\nimplementation(\"io.github.panpf.sketch4:sketch-animated-webp:${LAST_VERSION}\")\n\n\u002F\u002F Supports BlurHash format image\nimplementation(\"io.github.panpf.sketch4:sketch-blurhash:${LAST_VERSION}\")\n\n\u002F\u002F Support accessing compose resources through uri or placeholder, fallback, error, etc.\nimplementation(\"io.github.panpf.sketch4:sketch-compose-resources:${LAST_VERSION}\")\nimplementation(\"io.github.panpf.sketch4:sketch-extensions-compose-resources:${LAST_VERSION}\")\n\n\u002F\u002F Provides practical functions such as download progress, image type icons, \n\u002F\u002F  pausing loading during list scrolling, and saving cellular traffic.\nimplementation(\"io.github.panpf.sketch4:sketch-extensions-compose:${LAST_VERSION}\")\nimplementation(\"io.github.panpf.sketch4:sketch-extensions-view:${LAST_VERSION}\")\n\n\u002F\u002F [Android only] Support icon loading of apk files via file path \nimplementation(\"io.github.panpf.sketch4:sketch-extensions-apkicon:${LAST_VERSION}\")\n\n\u002F\u002F [Android only] Support loading icons of installed apps by package name and version code\nimplementation(\"io.github.panpf.sketch4:sketch-extensions-appicon:${LAST_VERSION}\")\n\n\u002F\u002F [JVM only] Support using HttpURLConnection to access network images\nimplementation(\"io.github.panpf.sketch4:sketch-http-hurl:${LAST_VERSION}\")\n\n\u002F\u002F [JVM only] Support using OkHttp to access network images\nimplementation(\"io.github.panpf.sketch4:sketch-http-okhttp:${LAST_VERSION}\")\n\n\u002F\u002F Supports using ktor version 2.x to access network images\nimplementation(\"io.github.panpf.sketch4:sketch-http-ktor2:${LAST_VERSION}\")\n\n\u002F\u002F Supports using ktor version 3.x to access network images\nimplementation(\"io.github.panpf.sketch4:sketch-http-ktor3:${LAST_VERSION}\")\n\n\u002F\u002F Provides koin integration support, instead of sketch-compose and sketch-view, \n\u002F\u002F and obtains Sketch instances from koin by default\nimplementation(\"io.github.panpf.sketch4:sketch-compose-koin:${LAST_VERSION}\")\nimplementation(\"io.github.panpf.sketch4:sketch-view-koin:${LAST_VERSION}\")\n\n\u002F\u002F Support SVG images\nimplementation(\"io.github.panpf.sketch4:sketch-svg:${LAST_VERSION}\")\n\n\u002F\u002F [Android only] Use Android's built-in MediaMetadataRetriever class to decode video frames\nimplementation(\"io.github.panpf.sketch4:sketch-video:${LAST_VERSION}\")\n\n\u002F\u002F [Android only] Decoding video frames using wseemann's FFmpegMediaMetadataRetriever library\nimplementation(\"io.github.panpf.sketch4:sketch-video-ffmpeg:${LAST_VERSION}\")\n```\n\n> [!TIP]\n> * `sketch-compose`, `sketch-view` Modules all depend on the singleton provided by\n    the `sketch-singleton` module. If you don’t need the singleton, you can directly rely on\n    their `*-core` version.\n> * The `sketch-http` module depends on `sketch-http-hurl` on jvm platforms and `sketch-http-ktor3`\n    on non-jvm platforms.\n\n### Register component\n\nSketch supports automatic discovery and registration of Fetcher and Decoder components, which are\nimplemented through ServiceLoader on the JVM platform and through the @EagerInitialization\nannotation on non-JVM platforms.\n\nAll built-in modules support automatic registration. If you want to disable automatic registration,\nplease refer to the documentation for manual\nregistration: [《Register component》][register_component]\n\n### R8 \u002F Proguard\n\n1. Android, iOS, Web and other platforms do not need to configure any obfuscation rules\n2. The following obfuscation rules are required for desktop platforms:\n    ```proguard\n    # -------------------------- Sketch Privider ---------------------------- #\n    -keep class * implements com.github.panpf.sketch.util.ComponentProvider { *; }\n    ```\n3. It may also be necessary to add obfuscation configurations to the indirect dependencies of\n   three-party libraries such as [Kotlin Coroutines], [OkHttp], [Okio]\n\n## Quickly Started\n\n### Compose Multiplatform:\n\n```kotlin\n\u002F\u002F val imageUri = \"\u002FUsers\u002Fmy\u002FDownloads\u002Fimage.jpg\"\n\u002F\u002F val imageUri = file:\u002F\u002F\u002Fcompose_resource\u002FcomposeResources\u002Fcom.github.panpf.sketch.sample.resources\u002Ffiles\u002Fsample.png\nval imageUri = \"https:\u002F\u002Fwww.sample.com\u002Fimage.jpg\"\n\nAsyncImage(\n    uri = imageUri,\n    contentDescription = \"photo\"\n)\n\nAsyncImage(\n    uri = imageUri,\n    state = rememberAsyncImageState(ComposableImageOptions {\n        placeholder(Res.drawable.placeholder)\n        error(Res.drawable.error)\n        crossfade()\n        \u002F\u002F There is a lot more...\n    }),\n    contentDescription = \"photo\"\n)\n\nAsyncImage(\n    rqeuest = ComposableImageRequest(imageUri) {\n        placeholder(Res.drawable.placeholder)\n        error(Res.drawable.error)\n        crossfade()\n        \u002F\u002F There is a lot more...\n    },\n    contentDescription = \"photo\"\n)\n\nImage(\n    painter = rememberAsyncImagePainter(\n        request = ComposableImageRequest(imageUri) {\n            placeholder(Res.drawable.placeholder)\n            error(Res.drawable.error)\n            crossfade()\n            \u002F\u002F There is a lot more...\n        }\n    ),\n    contentDescription = \"photo\"\n)\n```\n\n> [!TIP]\n> `placeholder(Res.drawable.placeholder)` needs to import the `sketch-compose-resources` module\n\n### Android View:\n\n```kotlin\n\u002F\u002F val imageUri = \"\u002Fsdcard\u002Fdownload\u002Fimage.jpg\"\n\u002F\u002F val imageUri = \"file:\u002F\u002F\u002Fandroid_asset\u002Fimage.jpg\"\n\u002F\u002F val imageUri = \"content:\u002F\u002Fmedia\u002Fexternal\u002Fimages\u002Fmedia\u002F88484\"\nval imageUri = \"https:\u002F\u002Fwww.sample.com\u002Fimage.jpg\"\n\nimageView.loadImage(imageUri)\n\nimageView.loadImage(imageUri) {\n    placeholder(R.drawable.placeholder)\n    error(R.drawable.error)\n    crossfade()\n    \u002F\u002F There is a lot more...\n}\n\nval request = ImageRequest(context, imageUri) {\n    placeholder(R.drawable.placeholder)\n    error(R.drawable.error)\n    crossfade()\n    target(imageView)\n    \u002F\u002F There is a lot more...\n}\ncontext.sketch.enqueue(request)\n```\n\n## Documents\n\nBasic functions:\n\n* [Get Started][getting_started]\n* [Register component][register_component]\n* [Compose][compose]\n* [Http: Load network images][http]\n* [AnimatedImage: GIF、WEBP、HEIF][animated_image]\n* [Resize: Modify the image size][resize]\n* [Transformation: Transformation image][transformation]\n* [Transition: Display images in cool transitions][transition]\n* [StateImage: Placeholder and error images][state_image]\n* [Thumbnail: Load low-resolution thumbnails first][thumbnail]\n* [Listener: Listen for request status and download progress][listener]\n* [DownloadCache: Understand download caching to avoid repeated downloads][download_cache]\n* [ResultCache: Understand result caching to avoid duplicate conversions][result_cache]\n* [MemoryCache: Understand memory caching to avoid repeated loading][memory_cache]\n* [Fetcher: Learn about Fetcher and extend new URI types][fetcher]\n* [Decoder: Understand the decoding process of Sketch][decoder]\n* [Target: Apply the load results to the target][target]\n* [SVG: Decode SVG still images][svg]\n* [VideoFrames: Decode video frames][video_frame]\n* [BlurHash][blurhash]\n* [ExifOrientation: Correct the image orientation][exif_orientation]\n* [ImageOptions: Manage image configurations in a unified manner][image_options]\n* [Interceptor: Intercept ImageRequest][interceptor]\n* [Preload images into memory][preload]\n* [Download images][download]\n* [Lifecycle][lifecycle]\n* [Log][log]\n* [Migrate][migrate]\n\nFeatured functions:\n\n* [SketchImageView: Configure the request through XML attributes][sketch_image_view]\n* [Improve the clarity of long images in grid lists][long_image_grid_thumbnails]\n* [Displays the download progress][progress_indicator]\n* [Displays the image type corner][mime_type_logo]\n* [Pause image downloads on cellular data to save data][save_cellular_traffic]\n* [The list slides to pause the loading of images][pause_load_when_scrolling]\n* [Displays an icon for an apk file or installed app][apk_app_icon]\n\n## Change log\n\nPlease review the [CHANGELOG.md] file\n\n## Test Platform\n\n* Android: Emulator; Arm64; API 21-34\n* Desktop: macOS; 14.6.1; JDK 17\n* iOS: iphone 16 simulator; iOS 18.1\n* Web: Chrome; 130\n\n## Run Sample App\n\nPrepare the environment:\n\n1. Android Studio: Norwhal+ (2025.1.1+)\n2. JDK: 17+\n3. Use [kdoctor] to check the running environment and follow the prompts to install the required\n   software\n4. Android Studio installs the `Kotlin Multiplatform` plugin\n\nRun the sample app:\n\n1. Clone the project and open it using Android Studio\n2. After synchronization is completed, the `Kotlin Multiplatform` plug-in will automatically create\n   a running configuration for each platform.\n3. Select the corresponding platform's running configuration, and then click Run\n\n## About version 4.0\n\n* The maven groupId is upgraded to `io.github.panpf.sketch4`, so versions 2.\\* and 3.\\* will not\n  prompt for upgrade\n* Version 4.0 is specially built for Compose Multiplatform, so there are many breaking changes in\n  the API, please upgrade with caution\n* Version 4.0 has made a lot of simplifications and is much simpler than version 3.0, please check\n  the update log for details\n* Android minimum API raised to API 21\n* Kotlin version upgraded to 2.0.0\n\n## Special thanks\n\n* [coil-kt\u002Fcoil][coil]: Sketch uses some code from Coil, including framework, compose and\n  sketch-animated movie part\n* [koral--\u002Fandroid-gif-drawable][android-gif-drawable]: animated-koralgif\n* [wseemann\u002FFFmpegMediaMetadataRetriever][FFmpegMediaMetadataRetriever]: video-ffmpeg\n* [BigBadaboom\u002Fandroidsvg][androidsvg]: svg\n\n## My Projects\n\nThe following are my other open source projects. If you are interested, you can learn about them:\n\n* [zoomimage](https:\u002F\u002Fgithub.com\u002Fpanpf\u002Fzoomimage): Library for zoom images, supported Android View,\n  Compose and Compose Multiplatform; supported double-click zoom, One or two fingers gesture zoom,\n  single-finger drag, inertial sliding, positioning, rotation, super-large image subsampling and\n  other functions.\n* [assembly-adapter](https:\u002F\u002Fgithub.com\u002Fpanpf\u002Fassembly-adapter): A library on Android that provides\n  multi-type Item implementations for various adapters. Incidentally, it also provides the most\n  powerful divider for RecyclerView.\n* [sticky-item-decoration](https:\u002F\u002Fgithub.com\u002Fpanpf\u002Fstickyitemdecoration): RecyclerView sticky item\n  implementation\n\n## License\n\nApache 2.0. See the [LICENSE](LICENSE.txt) file for details.\n\n[comment]: \u003C> (header)\n\n[license_image]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202-blue.svg\n\n[logo_image]: docs\u002Fimages\u002Flogo.png\n\n[license_link]: https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\n[platform_image]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPlatform-ComposeMultiplatform-brightgreen.svg\n\n[qq_group_image]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQQ%E4%BA%A4%E6%B5%81%E7%BE%A4-529630740-red.svg\n\n[version_icon]: https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fio.github.panpf.sketch4\u002Fsketch-singleton\n\n[version_link]: https:\u002F\u002Frepo1.maven.org\u002Fmaven2\u002Fio\u002Fgithub\u002Fpanpf\u002Fsketch4\u002F\n\n\n[comment]: \u003C> (wiki)\n\n[animated_image]: docs\u002Fanimated_image.md\n\n[apk_app_icon]: docs\u002Fapk_app_icon.md\n\n[compose]: docs\u002Fcompose.md\n\n[decoder]: docs\u002Fdecoder.md\n\n[download_cache]: docs\u002Fdownload_cache.md\n\n[exif_orientation]: docs\u002Fexif_orientation.md\n\n[fetcher]: docs\u002Ffetcher.md\n\n[getting_started]: docs\u002Fgetting_started.md\n\n[register_component]: docs\u002Fregister_component.md\n\n[http]: docs\u002Fhttp.md\n\n[image_options]: docs\u002Fimage_options.md\n\n[lifecycle]: docs\u002Flifecycle.md\n\n[listener]: docs\u002Flistener.md\n\n[log]: docs\u002Flog.md\n\n[long_image_grid_thumbnails]: docs\u002Flong_image_grid_thumbnails.md\n\n[memory_cache]: docs\u002Fmemory_cache.md\n\n[mime_type_logo]: docs\u002Fmime_type_logo.md\n\n[pause_load_when_scrolling]: docs\u002Fpause_load_when_scrolling.md\n\n[preload]: docs\u002Fpreload.md\n\n[download]: docs\u002Fdownload_image.md\n\n[progress_indicator]: docs\u002Fprogress_indicator.md\n\n[interceptor]: docs\u002Finterceptor.md\n\n[resize]: docs\u002Fresize.md\n\n[result_cache]: docs\u002Fresult_cache.md\n\n[save_cellular_traffic]: docs\u002Fsave_cellular_traffic.md\n\n[sketch_image_view]: docs\u002Fsketch_image_view.md\n\n[state_image]: docs\u002Fstate_image.md\n\n[thumbnail]: docs\u002Fthumbnail.md\n\n[svg]: docs\u002Fsvg.md\n\n[target]: docs\u002Ftarget.md\n\n[transformation]: docs\u002Ftransformation.md\n\n[transition]: docs\u002Ftransition.md\n\n[video_frame]: docs\u002Fvideo_frame.md\n\n[migrate]: docs\u002Fmigrate.md\n\n[blurhash]: docs\u002Fblurhash.md\n\n\n[comment]: \u003C> (links)\n\n\n[androidsvg]: https:\u002F\u002Fgithub.com\u002FBigBadaboom\u002Fandroidsvg\n\n[android-gif-drawable]: https:\u002F\u002Fgithub.com\u002Fkoral--\u002Fandroid-gif-drawable\n\n[coil]: https:\u002F\u002Fgithub.com\u002Fcoil-kt\u002Fcoil\n\n[FFmpegMediaMetadataRetriever]: https:\u002F\u002Fgithub.com\u002Fwseemann\u002FFFmpegMediaMetadataRetriever\n\n\n[Kotlin Coroutines]: https:\u002F\u002Fgithub.com\u002FKotlin\u002Fkotlinx.coroutines\u002Fblob\u002Fmaster\u002Fkotlinx-coroutines-core\u002Fjvm\u002Fresources\u002FMETA-INF\u002Fproguard\u002Fcoroutines.pro\n\n[OkHttp]: https:\u002F\u002Fsquare.github.io\u002Fokhttp\u002Ffeatures\u002Fr8_proguard\u002F\n\n[Okio]: https:\u002F\u002Fsquare.github.io\u002Fokio\u002F\n\n\n[compose_compiler_config.conf]: sketch-core\u002Fcompose_compiler_config.conf\n\n[stability_configuration]: https:\u002F\u002Fdeveloper.android.com\u002Fdevelop\u002Fui\u002Fcompose\u002Fperformance\u002Fstability\u002Ffix#configuration-file\n\n\n[comment]: \u003C> (footer)\n\n[CHANGELOG.md]: CHANGELOG.md\n\n[kdoctor]: https:\u002F\u002Fgithub.com\u002FKotlin\u002Fkdoctor\n","Sketch 是一个专为 Compose Multiplatform 和 Android View 设计的图像加载库。它支持从多种来源加载图片，包括 HTTP、文件、Compose 资源等，并具备强大的功能如三级缓存、自动取消请求、自动调整图片大小及根据 Exif 信息旋转图片等。此外，Sketch 还支持动图（GIF）、SVG 图像、Base64 编码图片和视频缩略图等功能，并且易于扩展，允许用户自定义缓存策略、解码器、变换效果等。适用于需要跨平台图像处理或在 Android 应用中高效展示多媒体内容的场景。该项目基于 Kotlin 及其协程技术开发，确保了现代性和高性能。","2026-06-11 03:12:39","top_language"]