AboutAndroid / McImage

McImage是一个插件帮助你检查你res中的大图和全量压缩你的res

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

McImage

中文文档

McImage is an Android Gradle Plugin.It can help you check the big image in your res and compress your all image in your res.

Include

  • The Image in Jar res
  • The Image in aar res
  • The Image in Module res

The Plugin use pngquant to compress image,it can save 70% size.

Use

First,change your root build.gradle.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.smallsoho.mobcase:McImage:0.0.1'
    }
}

Then, apply this plugin in the module build.gradle which you want to compress.

apply plugin: 'McImage'

Last, put the dir in your project root.Download from here

mctools

PS: the plugin is default in MAC OSX, if you want to use in other platform,please change the pngquant bintray in mctools.

Config

You can config the plugin in the build.gradle you apply this plugin.Include isCheck,isCompress and the max size of check.

McImageConfig {
  isCheck true //default true
  isCompress true //default true
  maxSize 1*1024*1024 //default 1MB 
}

Thanks

pngquant

About

McImage是一个插件帮助你检查你res中的大图和全量压缩你的res

License:Apache License 2.0


Languages

Language:Groovy 100.0%