All Projects → zh8637688 → AndroidWebP-GradlePlugin

zh8637688 / AndroidWebP-GradlePlugin

Licence: other
将图片转换成WebP格式的Android构建插件,自动下载 libwebp,支持手动转换与自动转换两种模式。

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to AndroidWebP-GradlePlugin

Imageprocessor
📷 A fluent wrapper around System.Drawing for the processing of image files.
Stars: ✭ 2,452 (+4904.08%)
Mutual labels:  webp
ipx
High performance, secure and easy to use image proxy based on Sharp and libvips.
Stars: ✭ 683 (+1293.88%)
Mutual labels:  webp
togglific
Do you find web animations distracting? Togglific provides a distraction-free web experience!
Stars: ✭ 17 (-65.31%)
Mutual labels:  webp
Quick Picture Viewer
🖼️ Lightweight, versatile desktop image viewer for Windows. The best replacement for the default Windows photo viewer.
Stars: ✭ 237 (+383.67%)
Mutual labels:  webp
video thumbnail
This plugin generates thumbnail from video file or URL. It returns image in memory or writes into a file. It offers rich options to control the image format, resolution and quality. Supports iOS and Android.
Stars: ✭ 159 (+224.49%)
Mutual labels:  webp
imagecodecs
Image transformation, compression, and decompression codecs. Forked from https://pypi.org/project/imagecodecs
Stars: ✭ 56 (+14.29%)
Mutual labels:  webp
Gulp Webp
Convert images to WebP
Stars: ✭ 187 (+281.63%)
Mutual labels:  webp
go-webp
Simple and fast webp library for golang
Stars: ✭ 91 (+85.71%)
Mutual labels:  webp
webp-imageio
Java ImageIO WebP support
Stars: ✭ 135 (+175.51%)
Mutual labels:  webp
sail
The missing small and fast image decoding library for humans (not for machines) ⛵ https://sail.software
Stars: ✭ 206 (+320.41%)
Mutual labels:  webp
manael
Manael is a simple HTTP proxy for processing images.
Stars: ✭ 34 (-30.61%)
Mutual labels:  webp
webp
Create a WebP copy for images (TYPO3 CMS)
Stars: ✭ 57 (+16.33%)
Mutual labels:  webp
gfxprim
Open-source modular 2D bitmap graphics library with emphasis on speed and correctness.
Stars: ✭ 32 (-34.69%)
Mutual labels:  webp
Apng4android
Android animation support for APNG & Animated WebP & Gif,High performance
Stars: ✭ 222 (+353.06%)
Mutual labels:  webp
JayantGoel001.github.io
My Personal Portfolio.
Stars: ✭ 31 (-36.73%)
Mutual labels:  webp
Twelvety
An Eleventy starter project built to be fast
Stars: ✭ 195 (+297.96%)
Mutual labels:  webp
lamba-thumbnailer
AWS S3 Video Thumbnailer with Lambda
Stars: ✭ 21 (-57.14%)
Mutual labels:  webp
image-optimizer
A free and open source tool for optimizing images and vector graphics.
Stars: ✭ 740 (+1410.2%)
Mutual labels:  webp
v-img
📸Use webp and lazyload images
Stars: ✭ 48 (-2.04%)
Mutual labels:  webp
webpjs
📷 WebP.js Polyfill
Stars: ✭ 25 (-48.98%)
Mutual labels:  webp

AndroidWebP-GradlePlugin

一款支持自动将图片转换成WebP格式的Android构建插件

功能:

  1. 支持将资源文件夹中的jpg、png图片转换成webp格式;
  2. 构建过程中自动下载libwebp,无需再配置环境;
  3. 支持手动与自动两种构建模式,祥见 配置
  4. 自动构建过程中,图片转换时机位于mergeResources之前,避免图片被重复处理多次;

接入:

  1. 引用插件

    buildscript {
        repositories {
            maven {
                url 'https://dl.bintray.com/zh8637688/maven/'
            }
        }
        dependencies {
            classpath 'cz.gradle.android:webp:0.0.1'
        }
    }
    
  2. 应用plugin

    apply plugin: 'cz.webp'
    
  3. 配置

    WebPAndroid {
        autoConvert true
        quality 75
    }
    
  4. 构建

    autoConvert = true:         ./gradlew build
    
    autoConvert = false:        ./gradlew convert***WebP
    

配置:

配置名称 类型 默认值 说明
quality int 75 指定转换过程中RGB通道的压缩因,取值范围0到100。值越小,压缩率越高,图片质量越低。
autoConvert boolean false 若设置为true,转换任务将自动加入构建过程,执行gradle build即可;若设置为false,需手动执行gradle convertWebP。

构建产物:

  • autoConvert = true,sourSets.res指定资源文件夹中所有jpg、png(非.9)图片将被转换为webp格式,原有图片将移动到projectDir/ori_res目录中。
  • autoConvert = false,原有图片路径不改变,转换后的webp图片位于projectDir/webp目录中。

TODO:

自动模式下暂不支持增量构建(convertWebP任务的输出会改变输入属性。将输出路径设置在build目录下,并在其他任务中屏蔽原先的图片即可)

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].