an image compression framework.(一个高保真、高压缩比的图片压缩框架)
一个图片压缩框架。
或
| 图片信息 | Tiny | 微信 |
|---|---|---|
| 6.66MB (3500x2156) | 151KB (1280x788) | 135KB (1280x788) |
| 4.28MB (4160x3120) | 219KB (1280x960) | 195KB (1280x960) |
| 2.60MB (4032x3024) | 193KB (1280x960) | 173KB (1280x960) |
| 372KB (500x500) | 38.67KB (500x500) | 34.05KB (500x500) |
| 236KB (960x1280) | 127KB (960x1280) | 118KB (960x1280) |
Tiny 不依赖任何库,在架构上保持代码简洁。Tiny 还使用异步线程池来压缩图片,并在压缩完成后在主线程中返回结果。
implementation 'com.zxy.android:tiny:1.1.0'Tiny 提供 abi:armeabi、armeabi-v7a、arm64-v8a、x86。
选择您需要的 "abi" 版本:
android {
defaultConfig {
ndk {
abiFilters 'armeabi','x86'//or armeabi-v7a、arm64-v8a、x86
}
}
} Tiny.getInstance().init(this);抱歉,我无法翻译“``` Tiny.BitmapCompressOptions options = new Tiny.BitmapCompressOptions(); //options.height = xxx;//some compression configuration. Tiny.getInstance().source("").asBitmap().withOptions(options).compress(new BitmapCallback() { @Override public void callback(boolean isSuccess, Bitmap bitmap, Throwable t) { //return the compressed bitmap object } });
//or sync compress.
BitmapResult result = Tiny.getInstance().source("").asBitmap().withOptions(options).compressSync();
#### **AsFile**
I am ready to translate your text from English to Simplified Chinese. Please provide the content you'd like me to translate.
Tiny.FileCompressOptions options = new Tiny.FileCompressOptions();
Tiny.getInstance().source("").asFile().withOptio
[ ](https://bintray.com/sunzxyong/maven/Tiny/_latestVersion)[]() []()
[Blog entry with introduction](http://zhengxiaoyong.com/2017/04/23/Android%E5%9B%BE%E7%89%87%E5%8E%8B%E7%BC%A9%E6%A1%86%E6%9E%B6-Tiny/)
[Introduction of compression](http://zhengxiaoyong.com/2017/04/23/%E4%B9%9F%E8%B0%88%E5%9B%BE%E7%89%87%E5%8E%8B%E7%BC%A9/)暂无开放 Issues,或尚未同步最近议题。