Giter VIP home page Giter VIP logo

ctsiplugin's Introduction

一、webp-plugin 插件

  • 简介 :
  1. 该插件是将PNG、JPG、JPEG 格式的图片转换为Webp格式,减小apk的大小;
  2. 在 minSdkVersion 小于18时,带有透明度的PNG 图片无法兼容4.3以下的机型,故此插件不转换,可兼容4.3以下设备;
  3. 无法转换的图片进行了,或者是转换之后比原图片还大的图片进行了压缩,PNG图片使用pngcrush工具压缩,JPG、JPEG格式图片使用Google提供的guetzli工具压缩;
  4. 该插件工具兼容Windows、Mac、Linux三个平台;
  5. 该插件无法兼容AndroidStudio 3.0的buidle构建工具,需要将工具版本设置为小于3.0,或者在项目的gradle.properties中设置:android.enableAapt2=false
  • 集成步骤
  1. 在项目根目录下buidle.gradle中添加插件
 dependencies {
        classpath 'com.ctsi.plugin:webp-plugin:2.0.0'
    }
  1. 在app module中的buidle.gradle 中添加
apply plugin: 'com.ctsi.plugin.webp'
  1. 在app module中的buidle.gradle 中配置webpConfig,默认开启,
webpConfig {
    quality = 75
    webpEnabled = true
}
  1. 执行打包即可将图片转换为Webp 格式;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.