All Projects → Sunzxyong → Tiny

Sunzxyong / Tiny

Licence: apache-2.0
Blog:https://zhengxiaoyong.com Wechat:

Programming Languages

c
50402 projects - #5 most used programming language
assembly
5116 projects
HTML
75241 projects
java
68154 projects - #9 most used programming language
PHP
23972 projects - #3 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Tiny

Lerc
Limited Error Raster Compression
Stars: ✭ 126 (-94.97%)
Mutual labels:  image-compression
Caesium Clt
Caesium Command Line Tools - Lossy/lossless image compression tool using mozjpeg and zopflipng
Stars: ✭ 149 (-94.05%)
Mutual labels:  image-compression
Snzip
Snzip, a compression/decompression tool based on snappy
Stars: ✭ 177 (-92.93%)
Mutual labels:  compress
Hsuntzu
HDFS compress tar zip snappy gzip uncompress untar codec hadoop spark
Stars: ✭ 135 (-94.61%)
Mutual labels:  compress
Optimize Images
A command-line interface (CLI) utility written in pure Python to help you reduce the file size of images.
Stars: ✭ 141 (-94.37%)
Mutual labels:  image-compression
Essential Image Optimization
Essential Image Optimization - an eBook
Stars: ✭ 1,950 (-22.16%)
Mutual labels:  image-compression
Img2ktx
Converts common image formats (PNG, JPG, etc.) to GPU-native compressed (BCn, ETC, ASTC) in KTX containers.
Stars: ✭ 117 (-95.33%)
Mutual labels:  image-compression
Compresshelper
🔥 压缩文件,压缩图片,压缩Bitmap,Compress, CompressImage, CompressFile, CompressBitmap:https://github.com/nanchen2251/AiYaCompressHelper
Stars: ✭ 2,362 (-5.71%)
Mutual labels:  compress
Waifu2x Extension
Image, GIF and Video enlarger/upscaler achieved with waifu2x and Anime4K. [NO LONGER UPDATED]
Stars: ✭ 149 (-94.05%)
Mutual labels:  image-compression
High Fidelity Generative Compression
Pytorch implementation of High-Fidelity Generative Image Compression + Routines for neural image compression
Stars: ✭ 171 (-93.17%)
Mutual labels:  image-compression
Cordova Plugin Mediapicker
cordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
Stars: ✭ 136 (-94.57%)
Mutual labels:  compress
Gtz
A high performance and compression ratio compressor for genomic data, powered by GTXLab of Genetalks.
Stars: ✭ 137 (-94.53%)
Mutual labels:  compress
Image Compressor
[Deprecated] No longer maintained, please use https://github.com/fengyuanchen/compressorjs
Stars: ✭ 167 (-93.33%)
Mutual labels:  image-compression
Slim
Surprisingly space efficient trie in Golang(11 bits/key; 100 ns/get).
Stars: ✭ 1,705 (-31.94%)
Mutual labels:  compress
Go Avif
🎨 Go AVIF library
Stars: ✭ 195 (-92.22%)
Mutual labels:  image-compression
Apiproject
[https://www.sofineday.com], golang项目开发脚手架,集成最佳实践(gin+gorm+go-redis+mongo+cors+jwt+json日志库zap(支持日志收集到kafka或mongo)+消息队列kafka+微信支付宝支付gopay+api加密+api反向代理+go modules依赖管理+headless爬虫chromedp+makefile+二进制压缩+livereload热加载)
Stars: ✭ 124 (-95.05%)
Mutual labels:  compress
Flora
可能是Android平台上最快的图片压缩框架。
Stars: ✭ 160 (-93.61%)
Mutual labels:  image-compression
Image Shrinker
App for macOS. Minify your images and graphics with just one drop. Autorenamed in the same place where it comes from. Immediately!
Stars: ✭ 217 (-91.34%)
Mutual labels:  image-compression
Tinify Php
PHP client for the Tinify API.
Stars: ✭ 204 (-91.86%)
Mutual labels:  image-compression
Luban
Luban(鲁班)—Image compression with efficiency very close to WeChat Moments/可能是最接近微信朋友圈的图片压缩算法
Stars: ✭ 12,794 (+410.74%)
Mutual labels:  image-compression

Tiny

an image compression framework.


Download Travis Hex.pm

Blog entry with introduction or Introduction of compression

Effect of compression

ImageInfo Tiny Wechat
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)

Introduce

Tiny does not depend on any library , it keeps the code clean on architecture . Tiny also uses an asynchronous thread pool to compress images , and will hand out the result in the main thread when compression is completed.

Usage

Installation

implementation 'com.zxy.android:tiny:1.1.0'

Choose an abi

Tiny provide abi:armeabiarmeabi-v7aarm64-v8ax86.

Choose what you need "abi" version:

android {
    defaultConfig {
        ndk {
            abiFilters 'armeabi','x86'//or armeabi-v7a、arm64-v8a、x86
        }
    }
}

Initialization

        Tiny.getInstance().init(this);

Compression

AsBitmap

        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

        Tiny.FileCompressOptions options = new Tiny.FileCompressOptions();
        Tiny.getInstance().source("").asFile().withOptions(options).compress(new FileCallback() {
            @Override
            public void callback(boolean isSuccess, String outfile, Throwable t) {
                //return the compressed file path
            }
        });
        
        //or sync compress.
        FileResult result = Tiny.getInstance().source("").asFile().withOptions(options).compressSync();

AsFileWithReturnBitmap

        Tiny.FileCompressOptions options = new Tiny.FileCompressOptions();
        Tiny.getInstance().source("").asFile().withOptions(options).compress(new FileWithBitmapCallback() {
            @Override
            public void callback(boolean isSuccess, Bitmap bitmap, String outfile, Throwable t) {
                //return the compressed file path and bitmap object
            }
        });
        
        //or sync compress.
        FileWithBitmapResult result = Tiny.getInstance().source("").asFile().withOptions(options).compressWithReturnBitmapSync();

BatchAsBitmap

        Tiny.BitmapCompressOptions options = new Tiny.BitmapCompressOptions();
        Tiny.getInstance().source("").batchAsBitmap().withOptions(options).batchCompress(new BitmapBatchCallback() {
            @Override
            public void callback(boolean isSuccess, Bitmap[] bitmaps, Throwable t) {
                //return the batch compressed bitmap object
            }
        });
        
        //or sync compress.
        BitmapBatchResult result = Tiny.getInstance().source("").batchAsBitmap().withOptions(options).batchCompressSync();

BatchAsFile

        Tiny.FileCompressOptions options = new Tiny.FileCompressOptions();
        Tiny.getInstance().source("").batchAsFile().withOptions(options).batchCompress(new FileBatchCallback() {
            @Override
            public void callback(boolean isSuccess, String[] outfile, Throwable t) {
                //return the batch compressed file path
            }
        });
        
        //or sync compress.
        FileBatchResult result = Tiny.getInstance().source("").batchAsFile().withOptions(options).batchCompressSync();

BatchAsFileWithReturnBitmap

        Tiny.FileCompressOptions options = new Tiny.FileCompressOptions();
        Tiny.getInstance().source("").batchAsFile().withOptions(options).batchCompress(new FileWithBitmapBatchCallback() {
            @Override
            public void callback(boolean isSuccess, Bitmap[] bitmaps, String[] outfile, Throwable t) {
                //return the batch compressed file path and bitmap object
            }
        });
        
        //or sync compress.
        FileWithBitmapBatchResult result = Tiny.getInstance().source("").batchAsFile().withOptions(options).batchCompressWithReturnBitmapResult();

Version

  • v0.0.1:The first version.
  • v0.0.2:Optimize the compression strategy,and handle with the orientation of bitmap.
  • v0.0.3:Unified as libtiny.so
  • v0.0.4:Add cover source file configuration—see{@link FileCompressOptions#overrideSource}, and setting up the batch compressed file paths—see {@link BatchFileCompressOptions#outfiles}
  • v0.0.5:Fix google store reject.
  • v0.0.6:Initialization is not must.Add clear compression directory method,see{@link Tiny#clearCompressDirectory}
  • v0.0.7:fix issue#29
  • v0.1.0:Add exception thrown interface, add the Throwable parameter to the callback method {@link xxxxCallback#callback}, see Update Introduce
  • v1.0.0:Add synchronous compression method and compression directory Settings.
  • v1.1.0:Add baseline setting support.

About

License

Apache License

Version 2.0, January 2004
http://www.apache.org/licenses/

Copyright 2018 郑晓勇

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].