Sketch

Sketch is a powerful and comprehensive image load library on Android, in addition to the basic functions, it also supports Jetpack Compose, GIF, SVG, video thumbnails, gesture zoom, huge images sampling, ExifInterface and other functions. Sketch 是 Android 上的一个强大且全面的图片加载库,除了基础功能外,还支持 Jetpack Compose、GIF、SVG、视频缩略图、手势缩放、超大图采样、ExifInterface 等功能。
Alternatives To Sketch
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Kroki2,306
4 days ago48August 16, 202387mitJavaScript
Creates diagrams from textual descriptions!
Sketch1,9141012 days ago41August 02, 20231apache-2.0Kotlin
Sketch is a powerful and comprehensive image load library on Android, in addition to the basic functions, it also supports Jetpack Compose, GIF, SVG, video thumbnails, gesture zoom, huge images sampling, ExifInterface and other functions. Sketch 是 Android 上的一个强大且全面的图片加载库,除了基础功能外,还支持 Jetpack Compose、GIF、SVG、视频缩略图、手势缩放、超大图采样、ExifInterface 等功能。
Fastimage1,3369,6131462 months ago52December 16, 20216mitRuby
FastImage finds the size or type of an image given its uri by fetching as little as needed
Cordova Plugin Camera9562,0135821 days ago40August 23, 202196apache-2.0Objective-C
Apache Cordova Plugin camera
React Native Img Cache69538144 years ago36December 03, 201850apache-2.0TypeScript
Image Cache for React Native
React Native Syan Image Picker609
a year ago85mitJava
React-Native 多图片选择 支持裁剪 压缩
Feelpp281
18 days ago97lgpl-3.0C++
:gem: Feel++: Finite Element Embedded Language and Library in C++
Tableexport251
4 years ago3May 04, 201717JavaScript
tableExport(table导出文件,支持json、csv、txt、xml、word、excel、image、pdf)
React Image File Resizer24883210 months ago36May 07, 202219mitJavaScript
Resize Local Images with React 🌄 🌅
Amazon Ecs Render Task Definition223
14 days ago30mitJavaScript
Inserts a container image URI into an Amazon ECS task definition JSON file.
Alternatives To Sketch
Select To Compare


Alternative Project Comparisons
Readme

logo_image Sketch Image Loader

Platform API License version_icon QQ Group

Sketch is a powerful and comprehensive image load library on Android, in addition to the basic functions, it also supports Jetpack Compose, GIF, SVG, video thumbnails, gesture zoom, huge images sampling, ExifInterface and other functions.
Sketch Android Jetpack ComposeGIFSVGExifInterface

Features/

  • Support http, asset, content, android.resource and other URIs
  • Support playing GIFs, WebP, HEIF and other animated image
  • Support gesture zoom and large image sampling
  • Supports download, conversion results, and memory L3 cache
  • Support for correcting image orientation via Exif
  • Supports Base64, video frames, SVG images
  • Support for Jetpack Compose
  • Supports automatic resizing of images according to the size of the view
  • Supports loading only pictures to memory or downloading only pictures to disk
  • Supports various useful features such as saving cellular data
  • Support the extension of URI, cache, decoding, conversion, display, placeholder and other links
  • Based on Kotlin and Kotlin coroutines
-----------------------
  • httpassetcontentandroid.resource URI
  • gifwebpheif
  • Exif
  • Base64SVG
  • Jetpack Compose
  • view
  • URI
  • Kotlin Kotlin

Import/

Published to mavenCentral mavenCentral

dependencies {
    implementation("io.github.panpf.sketch3:sketch:${LAST_VERSION}")
}

${LAST_VERSION}: Download (Not included 'v' 'v')

There are also optional modules to extend the functionality of sketch:
sketch

dependencies {
    // Support for Jetpack Compose
    //  Jetpack Compose
    implementation("io.github.panpf.sketch3:sketch-compose:${LAST_VERSION}")

    // Supports useful features such as download progress mask, pause loading during list swipe, save cellular traffic, image type corner marker, load apk file and installed app icon
    //  apk  app 
    implementation("io.github.panpf.sketch3:sketch-extensions:${LAST_VERSION}")

    // GifDrawable through Koral's android-gif-drawable library
    //  koral  android-gif-drawable  GifDrawable  gif 
    implementation("io.github.panpf.sketch3:sketch-gif-koral:${LAST_VERSION}")

    // GIF playback is achieved through Android's built-in Movie class
    //  Android  Movie  gif 
    implementation("io.github.panpf.sketch3:sketch-gif-movie:${LAST_VERSION}")

    // Support for OkHttp
    //  OkHttp
    implementation("io.github.panpf.sketch3:sketch-okhttp:${LAST_VERSION}")

    // SVG images are supported
    //  SVG 
    implementation("io.github.panpf.sketch3:sketch-svg:${LAST_VERSION}")

    // Video frames are read through Android's built-in MediaMetadataRetriever class
    //  Android  MediaMetadataRetriever 
    implementation("io.github.panpf.sketch3:sketch-video:${LAST_VERSION}")

    // Video frames are read through wseemann's FFmpegMediaMetadataRetriever library
    //  wseemann  FFmpegMediaMetadataRetriever 
    implementation("io.github.panpf.sketch3:sketch-video-ffmpeg:${LAST_VERSION}")

    // Supports gesture zoom and jumbo sampling
    // 
    implementation("io.github.panpf.sketch3:sketch-zoom:${LAST_VERSION}")
}

R8 / Proguard

Sketch doesn't need to configure any obfuscation rules itself, but you may need to add obfuscation configurations for indirectly dependent Kotlin Coroutines, OkHttp, Okio.
Sketch Kotlin Coroutines, OkHttp, Okio

Get started/

ImageView

Sketch provides a series of extended functions called displayImage for ImageView, which can easily display images
Sketch ImageView displayImage

// http
imageView.displayImage("https://www.sample.com/image.jpg")

// File
imageView.displayImage("/sdcard/download/image.jpg")

// asset
imageView.displayImage("asset://image.jpg")

// There is a lot more...

You can also configure parameters through a trailing lambda function:
lambda

imageView.displayImage("https://www.sample.com/image.jpg") {
    placeholder(R.drawable.placeholder)
    error(R.drawable.error)
    transformations(CircleCropTransformation())
    crossfade()
    // There is a lot more...
}

Jetpack Compose

Need import sketch-compose module sketch-compose

AsyncImage(
  imageUri = "https://www.sample.com/image.jpg",
  modifier = Modifier.size(300.dp, 200.dp),
  contentScale = ContentScale.Crop,
  contentDescription = ""
)

// config params
AsyncImage(
  rqeuest = DisplayRequest(LocalContext.current, "https://www.sample.com/image.jpg") {
    placeholder(R.drawable.placeholder)
    error(R.drawable.error)
    transformations(BlurTransformation())
    crossfade()
    // There is a lot more...
  },
  modifier = Modifier.size(300.dp, 200.dp),
  contentScale = ContentScale.Crop,
  contentDescription = ""
)

Document/

Basic features/

Featured features/

Changelog/

Please review the CHANGELOG.md file
CHANGELOG.md

About version 3.0/ 3.0

  • The maven groupId was changed to 'io.github.panpf.sketch3', so version 2.* will not prompt for an upgrade
  • The package name was changed to 'com.github.panpf.sketch' so it does not conflict with version 2.*
  • Based on the kotlin coroutine rewrite, APIs and functions are all refactored as a new library
  • There is no longer a requirement to use a SketchImageView, any ImageView and its subclasses will do, and any View can be supported in combination with a custom Target
  • The Zoom function is split into independent modules that can be relied on separately, and the large image sampling function is refactored and supports multi-threaded decoding, which is faster
  • The gif module now directly depends on the android-gif-drawable library, no longer modified twice, and can be upgraded by itself
  • Support for Jetpack Compose
  • Support for request and decode interceptors
  • Referring to coil v2.2.0 and combining with the original functionality of sketch, there are the following differences compared to coil:
    • sketch supports a minimum of API 16, while coil supports only API 21
    • Sketch supports bitmap reuse, while coil does not
    • Sketch supports more granular resizing of images
    • sketch clearly distinguishes between display, load, and download requests
    • sketch provides image scaling and display components and supports large image sampling
-----------------------
  • maven groupId io.github.panpf.sketch3 2.*
  • com.github.panpf.sketch 2.*
  • kotlin API
  • SketchImageView ImageView Target View
  • Zoom
  • gif android-gif-drawable
  • Jetpack Compose
  • coil v2.2.0 sketch coil
  • sketch API 16 coil API 21
  • sketch bitmap coil
  • sketch
  • sketch
  • sketch

Special thanks/

License

Copyright (C) 2022 panpf <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

[comment]: <> (header)

[comment]: <> (wiki)

[comment]: <> (links)

[comment]: <> (footer)

Popular Image Projects
Popular Uri Projects
Popular Media Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Kotlin
Sketch
Uri
Bitmap
Okhttp
Imageloader