├── LICENSE ├── MANIFEST.in ├── README.md ├── README_SMALL.md ├── extras ├── .DS_Store ├── frames │ ├── __init__.py │ ├── tmp-0.webp │ ├── tmp-1.webp │ ├── tmp-10.webp │ ├── tmp-11.webp │ ├── tmp-12.webp │ ├── tmp-13.webp │ ├── tmp-14.webp │ ├── tmp-2.webp │ ├── tmp-3.webp │ ├── tmp-4.webp │ ├── tmp-5.webp │ ├── tmp-6.webp │ ├── tmp-7.webp │ ├── tmp-8.webp │ └── tmp-9.webp ├── linux_logo.gif ├── python_logo.jpg ├── python_logo.webp └── python_logo1.jpg ├── lib ├── __init__.py ├── libwebp_linux │ ├── README │ ├── README.mux │ ├── __init__.py │ ├── bin │ │ ├── __init__.py │ │ ├── anim_diff │ │ ├── anim_dump │ │ ├── cwebp │ │ ├── dwebp │ │ ├── get_disto │ │ ├── gif2webp │ │ ├── img2webp │ │ ├── vwebp │ │ ├── webp_quality │ │ ├── webpinfo │ │ └── webpmux │ ├── doc │ │ ├── __init__.py │ │ ├── cwebp.html │ │ ├── cwebp.txt │ │ ├── dwebp.html │ │ ├── dwebp.txt │ │ ├── gif2webp.html │ │ ├── gif2webp.txt │ │ ├── img2webp.html │ │ ├── img2webp.txt │ │ ├── vwebp.html │ │ ├── vwebp.txt │ │ ├── webpinfo.html │ │ ├── webpinfo.txt │ │ ├── webpmux.html │ │ └── webpmux.txt │ ├── include │ │ ├── __init__.py │ │ └── webp │ │ │ ├── __init__.py │ │ │ ├── decode.h │ │ │ ├── demux.h │ │ │ ├── encode.h │ │ │ ├── mux.h │ │ │ ├── mux_types.h │ │ │ └── types.h │ └── lib │ │ ├── __init__.py │ │ ├── libwebp.a │ │ ├── libwebpdemux.a │ │ └── libwebpmux.a ├── libwebp_osx │ ├── README │ ├── README.mux │ ├── __init__.py │ ├── bin │ │ ├── __init__.py │ │ ├── anim_diff │ │ ├── anim_dump │ │ ├── cwebp │ │ ├── dwebp │ │ ├── get_disto │ │ ├── gif2webp │ │ ├── img2webp │ │ ├── vwebp │ │ ├── webp_quality │ │ ├── webpinfo │ │ └── webpmux │ ├── doc │ │ ├── __init__.py │ │ ├── cwebp.html │ │ ├── cwebp.txt │ │ ├── dwebp.html │ │ ├── dwebp.txt │ │ ├── gif2webp.html │ │ ├── gif2webp.txt │ │ ├── img2webp.html │ │ ├── img2webp.txt │ │ ├── vwebp.html │ │ ├── vwebp.txt │ │ ├── webpinfo.html │ │ ├── webpinfo.txt │ │ ├── webpmux.html │ │ └── webpmux.txt │ ├── include │ │ ├── __init__.py │ │ └── webp │ │ │ ├── __init__.py │ │ │ ├── decode.h │ │ │ ├── demux.h │ │ │ ├── encode.h │ │ │ ├── mux.h │ │ │ ├── mux_types.h │ │ │ └── types.h │ └── lib │ │ ├── __init__.py │ │ ├── libwebp.a │ │ ├── libwebpdemux.a │ │ └── libwebpmux.a ├── libwebp_win64 │ ├── Readme-mux.txt │ ├── Readme.txt │ ├── __init__.py │ ├── bin │ │ ├── __init__.py │ │ ├── anim_diff.exe │ │ ├── anim_dump.exe │ │ ├── cwebp.exe │ │ ├── dwebp.exe │ │ ├── freeglut.dll │ │ ├── get_disto.exe │ │ ├── gif2webp.exe │ │ ├── img2webp.exe │ │ ├── vwebp.exe │ │ ├── webp_quality.exe │ │ ├── webpinfo.exe │ │ └── webpmux.exe │ ├── include │ │ ├── __init__.py │ │ └── webp │ │ │ ├── __init__.py │ │ │ ├── decode.h │ │ │ ├── demux.h │ │ │ ├── encode.h │ │ │ ├── mux.h │ │ │ ├── mux_types.h │ │ │ └── types.h │ ├── lib │ │ ├── __init__.py │ │ ├── libwebp.lib │ │ ├── libwebpdemux.lib │ │ └── libwebpmux.lib │ ├── test.webp │ └── test_ref.ppm └── version_info.txt ├── setup.cfg ├── setup.py ├── test.py └── webptools ├── __init__.py ├── __pycache__ ├── __init__.cpython-36.pyc ├── webpbin.cpython-36.pyc └── webplib.cpython-36.pyc ├── webpbin.py └── webplib.py /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2021 Sai Kumar Yava 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | include README_SMALL.md 3 | include LICENSE 4 | include webptools/*.py 5 | 6 | include lib/libwebp_linux/bin/anim_diff 7 | include lib/libwebp_linux/bin/anim_dump 8 | include lib/libwebp_linux/bin/cwebp 9 | include lib/libwebp_linux/bin/dwebp 10 | include lib/libwebp_linux/bin/get_disto 11 | include lib/libwebp_linux/bin/gif2webp 12 | include lib/libwebp_linux/bin/img2webp 13 | include lib/libwebp_linux/bin/vwebp 14 | include lib/libwebp_linux/bin/webp_quality 15 | include lib/libwebp_linux/bin/webpinfo 16 | include lib/libwebp_linux/bin/webpmux 17 | 18 | include lib/libwebp_linux/doc/*.html 19 | include lib/libwebp_linux/doc/*.txt 20 | include lib/libwebp_linux/include/webp/*.h 21 | include lib/libwebp_linux/lib/*.a 22 | 23 | 24 | include lib/libwebp_osx/bin/anim_diff 25 | include lib/libwebp_osx/bin/anim_dump 26 | include lib/libwebp_osx/bin/cwebp 27 | include lib/libwebp_osx/bin/dwebp 28 | include lib/libwebp_osx/bin/get_disto 29 | include lib/libwebp_osx/bin/gif2webp 30 | include lib/libwebp_osx/bin/img2webp 31 | include lib/libwebp_osx/bin/vwebp 32 | include lib/libwebp_osx/bin/webp_quality 33 | include lib/libwebp_osx/bin/webpinfo 34 | include lib/libwebp_osx/bin/webpmux 35 | 36 | include lib/libwebp_osx/doc/*.html 37 | include lib/libwebp_osx/doc/*.txt 38 | include lib/libwebp_osx/include/webp/*.h 39 | include lib/libwebp_osx/lib/*.a 40 | 41 | include lib/libwebp_win64/bin/anim_diff.exe 42 | include lib/libwebp_win64/bin/anim_dump.exe 43 | include lib/libwebp_win64/bin/cwebp.exe 44 | include lib/libwebp_win64/bin/dwebp.exe 45 | include lib/libwebp_win32/bin/freeglut.dll 46 | include lib/libwebp_win64/bin/get_disto.exe 47 | include lib/libwebp_win64/bin/gif2webp.exe 48 | include lib/libwebp_win64/bin/img2webp.exe 49 | include lib/libwebp_win64/bin/vwebp.exe 50 | include lib/libwebp_win64/bin/webp_quality.exe 51 | include lib/libwebp_win64/bin/webpinfo.exe 52 | include lib/libwebp_win64/bin/webpmux.exe 53 | 54 | include lib/libwebp_win64/include/webp/*.h 55 | include lib/libwebp_win64/lib/*.lib -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [Webptools v0.0.9](https://pypi.org/project/webptools/) 2 | 3 | webptools is a Webp image conversion package for the python. 4 | 5 | Convert JPG,PNG.. images to webp image format 6 | 7 | This library uses precompiled executables of WebP(v1.1.0) for more info 8 | visit [WebP](https://developers.google.com/speed/webp) 9 | 10 | For converting other image formats to webp, please read this 11 | documentation [cwebp Encoder](https://developers.google.com/speed/webp/docs/cwebp) 12 | 13 | For converting webp image to other image format, please read this 14 | documentation [dwebp Encoder](https://developers.google.com/speed/webp/docs/dwebp) 15 | 16 | For converting gif image to webp, please read this 17 | documentation [gif2webp Converter](https://developers.google.com/speed/webp/docs/gif2webp) 18 | 19 | For creating animated webp image using webp images, please read this 20 | documentation [webpmux Muxer](https://developers.google.com/speed/webp/docs/webpmux) 21 | 22 | 23 | # How to use 24 | 25 | ## Installation 26 | 27 | ```shell 28 | $ pip install webptools 29 | ``` 30 | 31 | ## Fix Permission Issue (if not using external executables) 32 | 33 | ```python 34 | 35 | from webptools import grant_permission 36 | 37 | # this will grant 755 permission to webp executables 38 | grant_permission() 39 | 40 | ``` 41 | 42 | ### Using External executables 43 | 44 | ```python 45 | 46 | bin_path="libwebp_linux/bin/cwebp" 47 | 48 | ``` 49 | 50 | # cwebp 51 | 52 | ## Convert other image format to webp 53 | 54 | ```python 55 | 56 | from webptools import cwebp 57 | 58 | # pass input_image(.jpeg,.pnp .....) path , 59 | # output_image(give path where to save and image file name with .webp file type extension) 60 | print(cwebp(input_image="python_logo.jpg", output_image="python_logo.webp", 61 | option="-q 80", logging="-v")) 62 | 63 | 64 | ``` 65 | 66 | ## Convert base64 image to webp base64 67 | 68 | ```python 69 | 70 | from webptools import base64str2webp_base64str 71 | 72 | # pass base64 image, image type, webp options, 73 | # for the conversion temp location need 74 | 75 | # use the default temp path for conversion 76 | print( 77 | base64str2webp_base64str(base64str="", image_type="jpg", option="-q 80", 78 | logging="-v")) 79 | # use the custom temp path for conversion 80 | print(base64str2webp_base64str(base64str="", image_type="jpg", option="-q 80", 81 | temp_path="./temp", 82 | logging="-v")) 83 | 84 | ``` 85 | 86 | # dwebp 87 | 88 | ## Convert webp image to other image format 89 | 90 | ```python 91 | 92 | from webptools import dwebp 93 | 94 | # pass input_image(.webp image) path ,output_image(.jpeg,.pnp .....) 95 | print(dwebp(input_image="python_logo.webp", output_image="python_logo.jpg", 96 | option="-o", logging="-v")) 97 | 98 | ``` 99 | 100 | # gif2webp 101 | 102 | ## Convert gif image to webp 103 | 104 | ```python 105 | from webptools import gifwebp 106 | 107 | # pass input_image(.gif) path ,output_image(give path where to save and image file name with .webp file type extension) 108 | print(gifwebp(input_image="linux_logo.gif", output_image="linux_logo.webp", 109 | option="-q 80", logging="-v")) 110 | ``` 111 | 112 | # webpmux 113 | 114 | ## Add ICC profile,XMP metadata and EXIF metadata 115 | 116 | ```python 117 | from webptools import webpmux_add 118 | 119 | # pass input_image(.webp image) path,output_image,set options(icc image profile,XMP metadata or EXIF metadata) and file. 120 | # for options use keywords as below 121 | # for ICC: icc 122 | # for XMP metadata: xmp 123 | # for EXIF metadata: exif 124 | print(webpmux_add(input_image="in.webp", output_image="icc_container.webp", 125 | icc_profile="image_profile.icc", option="icc")) 126 | ``` 127 | 128 | ## Extract ICC profile,XMP metadata and EXIF metadata 129 | 130 | ```python 131 | 132 | from webptools import webpmux_extract 133 | 134 | # pass input_image(.webp image) path,output_image,set options(icc image profile,XMP metadata or EXIF metadata) and file. 135 | # for options use keywords as below 136 | # for ICC: icc 137 | # for XMP metadata: xmp 138 | # for EXIF metadata: exif 139 | print(webpmux_extract(input_image="anim_container.webp", 140 | icc_profile="image_profile.icc", option="icc")) 141 | ``` 142 | 143 | ## Strip ICC profile,XMP metadata and EXIF metadata 144 | 145 | ```python 146 | 147 | from webptools import webpmux_strip 148 | 149 | # pass input_image(.webp image) path,output_image,set options(icc image profile,XMP metadata or EXIF metadata) and file. 150 | # for options use keywords as below 151 | # for ICC: icc 152 | # for XMP metadata: xmp 153 | # for EXIF metadata: exif 154 | print(webpmux_strip(input_image="icc_container.webp", 155 | output_image="without_icc.webp", option="icc")) 156 | 157 | 158 | ``` 159 | 160 | ## Create an animated WebP file from Webp images 161 | 162 | ```python 163 | 164 | from webptools import webpmux_animate 165 | 166 | # pass input_images(.webp image) path with FRAME_OPTIONS, as array,ouput image will be animated .webp image 167 | 168 | # https://developers.google.com/speed/webp/docs/webpmux 169 | # FRAME_OPTIONS 170 | 171 | # -file_i +di[+xi+yi[+mi[bi]]] 172 | 173 | # e.g -frame one.webp +100 -frame two.webp +100+50+50 -frame three.webp +100+50+50+1+b 174 | 175 | # Where: file_i is the i'th frame (WebP format), xi,yi specify the image offset for this frame, 176 | # di is the pause duration before next frame, mi is the dispose method for this frame (0 for NONE or 1 for BACKGROUND) 177 | # and bi is the blending method for this frame (+b for BLEND or -b for NO_BLEND). 178 | # Argument bi can be omitted and will default to +b (BLEND). Also, mi can be omitted if bi is omitted and 179 | # will default to 0 (NONE). Finally, 180 | # if mi and bi are omitted then xi and yi can be omitted and will default to +0+0. 181 | 182 | # -loop n 183 | 184 | # e.g 10 185 | 186 | # Loop the frames n number of times. 0 indicates the frames should loop forever. 187 | # Valid range is 0 to 65535 [Default: 0 (infinite)]. 188 | 189 | # -bgcolor A,R,G,B 190 | 191 | # e.g 255,255,255,255 192 | 193 | # Background color of the canvas. Where: A, R, G and B are integers in the range 0 to 255 specifying 194 | # the Alpha, Red, Green and Blue component values respectively [Default: 255,255,255,255]. 195 | 196 | input = ["./frames/tmp-0.webp +100", "./frames/tmp-1.webp +100", 197 | "./frames/tmp-2.webp +100"] 198 | print(webpmux_animate(input_images=input, output_image="anim_container.webp", 199 | loop="10", bgcolor="255,255,255,255")) 200 | 201 | ``` 202 | 203 | ## Get a frame from an animated WebP file 204 | 205 | ```python 206 | 207 | from webptools import webpmux_getframe 208 | 209 | # pass input_image(.webp image) path ,output_image and frame number 210 | print(webpmux_getframe(input_image="anim_container.webp", 211 | output_image="frame_2.webp", frame_number="2")) 212 | 213 | 214 | ``` 215 | -------------------------------------------------------------------------------- /README_SMALL.md: -------------------------------------------------------------------------------- 1 | webptools is a Webp image conversion package for python. 2 | 3 | Convert JPG,PNG.. images to webp image format 4 | 5 | This library uses precompiled executables of WebP for more info visit [WebP](https://developers.google.com/speed/webp) 6 | 7 | For converting other image formats to webp, please read this documentation [cwebp Encoder](https://developers.google.com/speed/webp/docs/cwebp) 8 | 9 | For converting webp image to other image format, please read this documentation [dwebp Encoder](https://developers.google.com/speed/webp/docs/dwebp) 10 | 11 | For converting gif image to webp, please read this documentation [gif2webp Converter](https://developers.google.com/speed/webp/docs/gif2webp) 12 | 13 | For creating animated webp image using webp images, please read this documentation [webpmux Muxer](https://developers.google.com/speed/webp/docs/webpmux) 14 | 15 | 16 | ## For usage of this package click on github link 17 | 18 | [webptools](https://github.com/scionoftech/webptools) 19 | 20 | -------------------------------------------------------------------------------- /extras/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/.DS_Store -------------------------------------------------------------------------------- /extras/frames/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/__init__.py -------------------------------------------------------------------------------- /extras/frames/tmp-0.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-0.webp -------------------------------------------------------------------------------- /extras/frames/tmp-1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-1.webp -------------------------------------------------------------------------------- /extras/frames/tmp-10.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-10.webp -------------------------------------------------------------------------------- /extras/frames/tmp-11.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-11.webp -------------------------------------------------------------------------------- /extras/frames/tmp-12.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-12.webp -------------------------------------------------------------------------------- /extras/frames/tmp-13.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-13.webp -------------------------------------------------------------------------------- /extras/frames/tmp-14.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-14.webp -------------------------------------------------------------------------------- /extras/frames/tmp-2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-2.webp -------------------------------------------------------------------------------- /extras/frames/tmp-3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-3.webp -------------------------------------------------------------------------------- /extras/frames/tmp-4.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-4.webp -------------------------------------------------------------------------------- /extras/frames/tmp-5.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-5.webp -------------------------------------------------------------------------------- /extras/frames/tmp-6.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-6.webp -------------------------------------------------------------------------------- /extras/frames/tmp-7.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-7.webp -------------------------------------------------------------------------------- /extras/frames/tmp-8.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-8.webp -------------------------------------------------------------------------------- /extras/frames/tmp-9.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/frames/tmp-9.webp -------------------------------------------------------------------------------- /extras/linux_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/linux_logo.gif -------------------------------------------------------------------------------- /extras/python_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/python_logo.jpg -------------------------------------------------------------------------------- /extras/python_logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/python_logo.webp -------------------------------------------------------------------------------- /extras/python_logo1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/extras/python_logo1.jpg -------------------------------------------------------------------------------- /lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_linux/README.mux: -------------------------------------------------------------------------------- 1 |  __ __ ____ ____ ____ __ __ _ __ __ 2 | / \\/ \/ _ \/ _ \/ _ \/ \ \/ \___/_ / _\ 3 | \ / __/ _ \ __/ / / (_/ /__ 4 | \__\__/\_____/_____/__/ \__//_/\_____/__/___/v1.1.0 5 | 6 | 7 | Description: 8 | ============ 9 | 10 | WebPMux: set of two libraries 'Mux' and 'Demux' for creation, extraction and 11 | manipulation of an extended format WebP file, which can have features like 12 | color profile, metadata and animation. Reference command-line tools 'webpmux' 13 | and 'vwebp' as well as the WebP container specification 14 | 'doc/webp-container-spec.txt' are also provided in this package. 15 | 16 | WebP Mux tool: 17 | ============== 18 | 19 | The examples/ directory contains a tool (webpmux) for manipulating WebP 20 | files. The webpmux tool can be used to create an extended format WebP file and 21 | also to extract or strip relevant data from such a file. 22 | 23 | A list of options is available using the -help command line flag: 24 | 25 | > webpmux -help 26 | Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT 27 | webpmux -set SET_OPTIONS INPUT -o OUTPUT 28 | webpmux -duration DURATION_OPTIONS [-duration ...] 29 | INPUT -o OUTPUT 30 | webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT 31 | webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT] 32 | [-bgcolor BACKGROUND_COLOR] -o OUTPUT 33 | webpmux -info INPUT 34 | webpmux [-h|-help] 35 | webpmux -version 36 | webpmux argument_file_name 37 | 38 | GET_OPTIONS: 39 | Extract relevant data: 40 | icc get ICC profile 41 | exif get EXIF metadata 42 | xmp get XMP metadata 43 | frame n get nth frame 44 | 45 | SET_OPTIONS: 46 | Set color profile/metadata: 47 | icc file.icc set ICC profile 48 | exif file.exif set EXIF metadata 49 | xmp file.xmp set XMP metadata 50 | where: 'file.icc' contains the ICC profile to be set, 51 | 'file.exif' contains the EXIF metadata to be set 52 | 'file.xmp' contains the XMP metadata to be set 53 | 54 | DURATION_OPTIONS: 55 | Set duration of selected frames: 56 | duration set duration for each frames 57 | duration,frame set duration of a particular frame 58 | duration,start,end set duration of frames in the 59 | interval [start,end]) 60 | where: 'duration' is the duration in milliseconds 61 | 'start' is the start frame index 62 | 'end' is the inclusive end frame index 63 | The special 'end' value '0' means: last frame. 64 | 65 | STRIP_OPTIONS: 66 | Strip color profile/metadata: 67 | icc strip ICC profile 68 | exif strip EXIF metadata 69 | xmp strip XMP metadata 70 | 71 | FRAME_OPTIONS(i): 72 | Create animation: 73 | file_i +di+[xi+yi[+mi[bi]]] 74 | where: 'file_i' is the i'th animation frame (WebP format), 75 | 'di' is the pause duration before next frame, 76 | 'xi','yi' specify the image offset for this frame, 77 | 'mi' is the dispose method for this frame (0 or 1), 78 | 'bi' is the blending method for this frame (+b or -b) 79 | 80 | LOOP_COUNT: 81 | Number of times to repeat the animation. 82 | Valid range is 0 to 65535 [Default: 0 (infinite)]. 83 | 84 | BACKGROUND_COLOR: 85 | Background color of the canvas. 86 | A,R,G,B 87 | where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying 88 | the Alpha, Red, Green and Blue component values respectively 89 | [Default: 255,255,255,255] 90 | 91 | INPUT & OUTPUT are in WebP format. 92 | 93 | Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be 94 | valid. 95 | 96 | Note: if a single file name is passed as the argument, the arguments will be 97 | tokenized from this file. The file name must not start with the character '-'. 98 | 99 | Visualization tool: 100 | =================== 101 | 102 | The examples/ directory also contains a tool (vwebp) for viewing WebP files. 103 | It decodes the image and visualizes it using OpenGL. See the libwebp README 104 | for details on building and running this program. 105 | 106 | Mux API: 107 | ======== 108 | The Mux API contains methods for adding data to and reading data from WebP 109 | files. This API currently supports XMP/EXIF metadata, ICC profile and animation. 110 | Other features may be added in subsequent releases. 111 | 112 | Example#1 (pseudo code): Creating a WebPMux object with image data, color 113 | profile and XMP metadata. 114 | 115 | int copy_data = 0; 116 | WebPMux* mux = WebPMuxNew(); 117 | // ... (Prepare image data). 118 | WebPMuxSetImage(mux, &image, copy_data); 119 | // ... (Prepare ICC profile data). 120 | WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); 121 | // ... (Prepare XMP metadata). 122 | WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); 123 | // Get data from mux in WebP RIFF format. 124 | WebPMuxAssemble(mux, &output_data); 125 | WebPMuxDelete(mux); 126 | // ... (Consume output_data; e.g. write output_data.bytes to file). 127 | WebPDataClear(&output_data); 128 | 129 | 130 | Example#2 (pseudo code): Get image and color profile data from a WebP file. 131 | 132 | int copy_data = 0; 133 | // ... (Read data from file). 134 | WebPMux* mux = WebPMuxCreate(&data, copy_data); 135 | WebPMuxGetFrame(mux, 1, &image); 136 | // ... (Consume image; e.g. call WebPDecode() to decode the data). 137 | WebPMuxGetChunk(mux, "ICCP", &icc_profile); 138 | // ... (Consume icc_profile). 139 | WebPMuxDelete(mux); 140 | free(data); 141 | 142 | 143 | For a detailed Mux API reference, please refer to the header file 144 | (src/webp/mux.h). 145 | 146 | Demux API: 147 | ========== 148 | The Demux API enables extraction of images and extended format data from 149 | WebP files. This API currently supports reading of XMP/EXIF metadata, ICC 150 | profile and animated images. Other features may be added in subsequent 151 | releases. 152 | 153 | Code example: Demuxing WebP data to extract all the frames, ICC profile 154 | and EXIF/XMP metadata. 155 | 156 | WebPDemuxer* demux = WebPDemux(&webp_data); 157 | uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); 158 | uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); 159 | // ... (Get information about the features present in the WebP file). 160 | uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); 161 | 162 | // ... (Iterate over all frames). 163 | WebPIterator iter; 164 | if (WebPDemuxGetFrame(demux, 1, &iter)) { 165 | do { 166 | // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), 167 | // ... and get other frame properties like width, height, offsets etc. 168 | // ... see 'struct WebPIterator' below for more info). 169 | } while (WebPDemuxNextFrame(&iter)); 170 | WebPDemuxReleaseIterator(&iter); 171 | } 172 | 173 | // ... (Extract metadata). 174 | WebPChunkIterator chunk_iter; 175 | if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); 176 | // ... (Consume the ICC profile in 'chunk_iter.chunk'). 177 | WebPDemuxReleaseChunkIterator(&chunk_iter); 178 | if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); 179 | // ... (Consume the EXIF metadata in 'chunk_iter.chunk'). 180 | WebPDemuxReleaseChunkIterator(&chunk_iter); 181 | if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); 182 | // ... (Consume the XMP metadata in 'chunk_iter.chunk'). 183 | WebPDemuxReleaseChunkIterator(&chunk_iter); 184 | WebPDemuxDelete(demux); 185 | 186 | 187 | For a detailed Demux API reference, please refer to the header file 188 | (src/webp/demux.h). 189 | 190 | AnimEncoder API: 191 | ================ 192 | The AnimEncoder API can be used to create animated WebP images. 193 | 194 | Code example: 195 | 196 | WebPAnimEncoderOptions enc_options; 197 | WebPAnimEncoderOptionsInit(&enc_options); 198 | // ... (Tune 'enc_options' as needed). 199 | WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); 200 | while() { 201 | WebPConfig config; 202 | WebPConfigInit(&config); 203 | // ... (Tune 'config' as needed). 204 | WebPAnimEncoderAdd(enc, frame, duration, &config); 205 | } 206 | WebPAnimEncoderAssemble(enc, webp_data); 207 | WebPAnimEncoderDelete(enc); 208 | // ... (Write the 'webp_data' to a file, or re-mux it further). 209 | 210 | 211 | For a detailed AnimEncoder API reference, please refer to the header file 212 | (src/webp/mux.h). 213 | 214 | AnimDecoder API: 215 | ================ 216 | This AnimDecoder API allows decoding (possibly) animated WebP images. 217 | 218 | Code Example: 219 | 220 | WebPAnimDecoderOptions dec_options; 221 | WebPAnimDecoderOptionsInit(&dec_options); 222 | // Tune 'dec_options' as needed. 223 | WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); 224 | WebPAnimInfo anim_info; 225 | WebPAnimDecoderGetInfo(dec, &anim_info); 226 | for (uint32_t i = 0; i < anim_info.loop_count; ++i) { 227 | while (WebPAnimDecoderHasMoreFrames(dec)) { 228 | uint8_t* buf; 229 | int timestamp; 230 | WebPAnimDecoderGetNext(dec, &buf, ×tamp); 231 | // ... (Render 'buf' based on 'timestamp'). 232 | // ... (Do NOT free 'buf', as it is owned by 'dec'). 233 | } 234 | WebPAnimDecoderReset(dec); 235 | } 236 | const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); 237 | // ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). 238 | WebPAnimDecoderDelete(dec); 239 | 240 | For a detailed AnimDecoder API reference, please refer to the header file 241 | (src/webp/demux.h). 242 | 243 | 244 | Bugs: 245 | ===== 246 | 247 | Please report all bugs to the issue tracker: 248 | https://bugs.chromium.org/p/webp 249 | Patches welcome! See this page to get started: 250 | http://www.webmproject.org/code/contribute/submitting-patches/ 251 | 252 | Discuss: 253 | ======== 254 | 255 | Email: webp-discuss@webmproject.org 256 | Web: http://groups.google.com/a/webmproject.org/group/webp-discuss 257 | -------------------------------------------------------------------------------- /lib/libwebp_linux/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/anim_diff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/anim_diff -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/anim_dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/anim_dump -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/cwebp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/cwebp -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/dwebp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/dwebp -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/get_disto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/get_disto -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/gif2webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/gif2webp -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/img2webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/img2webp -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/vwebp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/vwebp -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/webp_quality: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/webp_quality -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/webpinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/webpinfo -------------------------------------------------------------------------------- /lib/libwebp_linux/bin/webpmux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/bin/webpmux -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/doc/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/dwebp.txt: -------------------------------------------------------------------------------- 1 | DWEBP(1) General Commands Manual DWEBP(1) 2 | 3 | 4 | 5 | NAME 6 | dwebp - decompress a WebP file to an image file 7 | 8 | SYNOPSIS 9 | dwebp [options] input_file.webp 10 | 11 | DESCRIPTION 12 | This manual page documents the dwebp command. 13 | 14 | dwebp decompresses WebP files into PNG, PAM, PPM or PGM images. 15 | 16 | OPTIONS 17 | The basic options are: 18 | 19 | -h Print usage summary. 20 | 21 | -version 22 | Print the version number (as major.minor.revision) and exit. 23 | 24 | -o string 25 | Specify the name of the output file (as PNG format by default). 26 | Using "-" as output name will direct output to 'stdout'. 27 | 28 | -- string 29 | Explicitly specify the input file. This option is useful if the 30 | input file starts with an '-' for instance. This option must ap- 31 | pear last. Any other options afterward will be ignored. If the 32 | input file is "-", the data will be read from stdin instead of a 33 | file. 34 | 35 | -bmp Change the output format to uncompressed BMP. 36 | 37 | -tiff Change the output format to uncompressed TIFF. 38 | 39 | -pam Change the output format to PAM (retains alpha). 40 | 41 | -ppm Change the output format to PPM (discards alpha). 42 | 43 | -pgm Change the output format to PGM. The output consists of 44 | luma/chroma samples instead of RGB, using the IMC4 layout. This 45 | option is mainly for verification and debugging purposes. 46 | 47 | -yuv Change the output format to raw YUV. The output consists of 48 | luma/chroma-U/chroma-V samples instead of RGB, saved sequen- 49 | tially as individual planes. This option is mainly for verifica- 50 | tion and debugging purposes. 51 | 52 | -nofancy 53 | Don't use the fancy upscaler for YUV420. This may lead to jaggy 54 | edges (especially the red ones), but should be faster. 55 | 56 | -nofilter 57 | Don't use the in-loop filtering process even if it is required 58 | by the bitstream. This may produce visible blocks on the non- 59 | compliant output, but it will make the decoding faster. 60 | 61 | -dither strength 62 | Specify a dithering strength between 0 and 100. Dithering is a 63 | post-processing effect applied to chroma components in lossy 64 | compression. It helps by smoothing gradients and avoiding band- 65 | ing artifacts. 66 | 67 | -alpha_dither 68 | If the compressed file contains a transparency plane that was 69 | quantized during compression, this flag will allow dithering the 70 | reconstructed plane in order to generate smoother transparency 71 | gradients. 72 | 73 | -nodither 74 | Disable all dithering (default). 75 | 76 | -mt Use multi-threading for decoding, if possible. 77 | 78 | -crop x_position y_position width height 79 | Crop the decoded picture to a rectangle with top-left corner at 80 | coordinates (x_position, y_position) and size width x height. 81 | This cropping area must be fully contained within the source 82 | rectangle. The top-left corner will be snapped to even coordi- 83 | nates if needed. This option is meant to reduce the memory 84 | needed for cropping large images. Note: the cropping is applied 85 | before any scaling. 86 | 87 | -flip Flip decoded image vertically (can be useful for OpenGL textures 88 | for instance). 89 | 90 | -resize, -scale width height 91 | Rescale the decoded picture to dimension width x height. This 92 | option is mostly intended to reducing the memory needed to de- 93 | code large images, when only a small version is needed (thumb- 94 | nail, preview, etc.). Note: scaling is applied after cropping. 95 | If either (but not both) of the width or height parameters is 0, 96 | the value will be calculated preserving the aspect-ratio. 97 | 98 | -quiet Do not print anything. 99 | 100 | -v Print extra information (decoding time in particular). 101 | 102 | -noasm Disable all assembly optimizations. 103 | 104 | 105 | BUGS 106 | Please report all bugs to the issue tracker: 107 | https://bugs.chromium.org/p/webp 108 | Patches welcome! See this page to get started: http://www.webmpro- 109 | ject.org/code/contribute/submitting-patches/ 110 | 111 | 112 | EXAMPLES 113 | dwebp picture.webp -o output.png 114 | dwebp picture.webp -ppm -o output.ppm 115 | dwebp -o output.ppm -- ---picture.webp 116 | cat picture.webp | dwebp -o - -- - > output.ppm 117 | 118 | 119 | AUTHORS 120 | dwebp is a part of libwebp and was written by the WebP team. 121 | The latest source tree is available at https://chromium.google- 122 | source.com/webm/libwebp 123 | 124 | This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). 126 | 127 | 128 | SEE ALSO 129 | cwebp(1), gif2webp(1), webpmux(1) 130 | Please refer to http://developers.google.com/speed/webp/ for additional 131 | information. 132 | 133 | Output file format details 134 | PAM: http://netpbm.sourceforge.net/doc/pam.html 135 | PGM: http://netpbm.sourceforge.net/doc/pgm.html 136 | PPM: http://netpbm.sourceforge.net/doc/ppm.html 137 | PNG: http://www.libpng.org/pub/png/png-sitemap.html#info 138 | 139 | 140 | 141 | June 23, 2016 DWEBP(1) 142 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/gif2webp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | GIF2WEBP 17 | 18 | 19 | 20 | 21 |

GIF2WEBP

22 | 23 | NAME
24 | SYNOPSIS
25 | DESCRIPTION
26 | OPTIONS
27 | BUGS
28 | EXAMPLES
29 | AUTHORS
30 | SEE ALSO
31 | 32 |
33 | 34 | 35 |

NAME 36 | 37 |

38 | 39 | 40 |

gif2webp - 41 | Convert a GIF image to WebP

42 | 43 |

SYNOPSIS 44 | 45 |

46 | 47 | 48 | 49 |

gif2webp 50 | [options] input_file.gif -o 51 | output_file.webp

52 | 53 |

DESCRIPTION 54 | 55 |

56 | 57 | 58 |

This manual 59 | page documents the gif2webp command.

60 | 61 | 62 |

gif2webp 63 | converts a GIF image to a WebP image.

64 | 65 |

OPTIONS 66 | 67 |

68 | 69 | 70 |

The basic 71 | options are:
72 | -o
string

73 | 74 |

Specify the name of the output 75 | WebP file. If omitted, gif2webp will perform 76 | conversion but only report statistics. Using "-" 77 | as output name will direct output to 78 | ’stdout’.

79 | 80 |

-- string

81 | 82 |

Explicitly specify the input 83 | file. This option is useful if the input file starts with an 84 | ’-’ for instance. This option must appear 85 | last. Any other options afterward will be ignored. If 86 | the input file is "-", the data will be read from 87 | stdin instead of a file.

88 | 89 |

-h, -help

90 | 91 |

Usage information.

92 | 93 |

-version

94 | 95 |

Print the version number (as 96 | major.minor.revision) and exit.

97 | 98 | 100 | 101 | 102 | 106 | 107 | 111 | 112 | 113 | 117 | 118 | 124 |
103 | 104 | 105 |

-lossy

108 | 109 | 110 |

Encode the image using lossy compression.

114 | 115 | 116 |

-mixed

119 | 120 | 121 |

Mixed compression mode: optimize compression of the 122 | image by picking either lossy or lossless compression for 123 | each frame heuristically.

125 | 126 |

-q float

127 | 128 |

Specify the compression factor 129 | for RGB channels between 0 and 100. The default is 75.
130 | In case of lossless compression (default), a small factor 131 | enables faster compression speed, but produces a larger 132 | file. Maximum compression is achieved by using a value of 133 | 100.
134 | In case of lossy compression (specified by the -lossy 135 | option), a small factor produces a smaller file with lower 136 | quality. Best quality is achieved by using a value of 137 | 100.

138 | 139 | 141 | 142 | 143 | 147 | 148 | 159 |
144 | 145 | 146 |

-m int

149 | 150 | 151 |

Specify the compression method to use. This parameter 152 | controls the trade off between encoding speed and the 153 | compressed file size and quality. Possible values range from 154 | 0 to 6. Default value is 4. When higher values are used, the 155 | encoder will spend more time inspecting additional encoding 156 | possibilities and decide on the quality gain. Lower value 157 | can result is faster processing time at the expense of 158 | larger file size and lower compression quality.

160 | 161 |

-min_size

162 | 163 |

Encode image to achieve 164 | smallest size. This disables key frame insertion and picks 165 | the dispose method resulting in smallest output for each 166 | frame. It uses lossless compression by default, but can be 167 | combined with -q, -m, -lossy or -mixed options.

168 | 169 |

-kmin int
170 | -kmax
int

171 | 172 |

Specify the minimum and maximum 173 | distance between consecutive key frames (independently 174 | decodable frames) in the output animation. The tool will 175 | insert some key frames into the output animation as needed 176 | so that this criteria is satisfied.
177 | A ’kmax’ value of 0 will turn off insertion of 178 | key frames. A ’kmax’ value of 1 will result in 179 | all frames being key frames. ’kmin’ value is not 180 | taken into account in both these special cases. Typical 181 | values are in the range 3 to 30. Default values are kmin = 182 | 9, kmax = 17 for lossless compression and kmin = 3, kmax = 5 183 | for lossy compression.
184 | These two options are relevant only for animated images with 185 | large number of frames (>50).
186 | When lower values are used, more frames will be converted to 187 | key frames. This may lead to smaller number of frames 188 | required to decode a frame on average, thereby improving the 189 | decoding performance. But this may lead to slightly bigger 190 | file sizes. Higher values may lead to worse decoding 191 | performance, but smaller file sizes.
192 | Some restrictions:
193 | (i) kmin < kmax,
194 | (ii) kmin >= kmax / 2 + 1 and
195 | (iii) kmax - kmin <= 30.
196 | If any of these restrictions are not met, they will be 197 | enforced automatically.

198 | 199 |

-metadata 200 | string

201 | 202 |

A comma separated list of 203 | metadata to copy from the input to the output if present. 204 | Valid values: all, none, icc, 205 | xmp. The default is xmp.

206 | 207 | 209 | 210 | 211 | 215 | 216 | 227 | 228 | 229 | 233 | 234 | 238 |
212 | 213 | 214 |

-f int

217 | 218 | 219 |

For lossy encoding only (specified by the -lossy 220 | option). Specify the strength of the deblocking filter, 221 | between 0 (no filtering) and 100 (maximum filtering). A 222 | value of 0 will turn off any filtering. Higher value will 223 | increase the strength of the filtering process applied after 224 | decoding the picture. The higher the value the smoother the 225 | picture will appear. Typical values are usually in the range 226 | of 20 to 50.

230 | 231 | 232 |

-mt

235 | 236 | 237 |

Use multi-threading for encoding, if possible.

239 | 240 |

-loop_compatibility

241 | 242 |

If enabled, handle the loop 243 | information in a compatible fashion for Chrome version prior 244 | to M62 (inclusive) and Firefox.

245 | 246 | 248 | 249 | 250 | 254 | 255 | 259 | 261 | 262 | 263 | 267 | 268 | 272 | 274 |
251 | 252 | 253 |

-v

256 | 257 | 258 |

Print extra information.

260 |
264 | 265 | 266 |

-quiet

269 | 270 | 271 |

Do not print anything.

273 |
275 | 276 |

BUGS 277 | 278 |

279 | 280 | 281 |

Please report 282 | all bugs to the issue tracker: 283 | https://bugs.chromium.org/p/webp
284 | Patches welcome! See this page to get started: 285 | http://www.webmproject.org/code/contribute/submitting-patches/

286 | 287 |

EXAMPLES 288 | 289 |

290 | 291 | 292 |

gif2webp 293 | picture.gif -o picture.webp
294 | gif2webp -q 70 picture.gif -o picture.webp
295 | gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp
296 | gif2webp -lossy -f 50 picture.gif -o picture.webp
297 | gif2webp -q 70 -o picture.webp -- ---picture.gif
298 | cat picture.gif | gif2webp -o - -- - > output.webp

299 | 300 |

AUTHORS 301 | 302 |

303 | 304 | 305 | 306 |

gif2webp 307 | is a part of libwebp and was written by the WebP team.
308 | The latest source tree is available at 309 | https://chromium.googlesource.com/webm/libwebp

310 | 311 |

This manual 312 | page was written by Urvang Joshi <urvang@google.com>, 313 | for the Debian project (and may be used by others).

314 | 315 |

SEE ALSO 316 | 317 |

318 | 319 | 320 | 321 |

cwebp(1), 322 | dwebp(1), webpmux(1)
323 | Please refer to http://developers.google.com/speed/webp/ for 324 | additional information.

325 |
326 | 327 | 328 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/gif2webp.txt: -------------------------------------------------------------------------------- 1 | GIF2WEBP(1) General Commands Manual GIF2WEBP(1) 2 | 3 | 4 | 5 | NAME 6 | gif2webp - Convert a GIF image to WebP 7 | 8 | SYNOPSIS 9 | gif2webp [options] input_file.gif -o output_file.webp 10 | 11 | DESCRIPTION 12 | This manual page documents the gif2webp command. 13 | 14 | gif2webp converts a GIF image to a WebP image. 15 | 16 | OPTIONS 17 | The basic options are: 18 | 19 | -o string 20 | Specify the name of the output WebP file. If omitted, gif2webp 21 | will perform conversion but only report statistics. Using "-" 22 | as output name will direct output to 'stdout'. 23 | 24 | -- string 25 | Explicitly specify the input file. This option is useful if the 26 | input file starts with an '-' for instance. This option must ap- 27 | pear last. Any other options afterward will be ignored. If the 28 | input file is "-", the data will be read from stdin instead of a 29 | file. 30 | 31 | -h, -help 32 | Usage information. 33 | 34 | -version 35 | Print the version number (as major.minor.revision) and exit. 36 | 37 | -lossy Encode the image using lossy compression. 38 | 39 | -mixed Mixed compression mode: optimize compression of the image by 40 | picking either lossy or lossless compression for each frame 41 | heuristically. 42 | 43 | -q float 44 | Specify the compression factor for RGB channels between 0 and 45 | 100. The default is 75. 46 | In case of lossless compression (default), a small factor en- 47 | ables faster compression speed, but produces a larger file. Max- 48 | imum compression is achieved by using a value of 100. 49 | In case of lossy compression (specified by the -lossy option), a 50 | small factor produces a smaller file with lower quality. Best 51 | quality is achieved by using a value of 100. 52 | 53 | -m int Specify the compression method to use. This parameter controls 54 | the trade off between encoding speed and the compressed file 55 | size and quality. Possible values range from 0 to 6. Default 56 | value is 4. When higher values are used, the encoder will spend 57 | more time inspecting additional encoding possibilities and de- 58 | cide on the quality gain. Lower value can result is faster pro- 59 | cessing time at the expense of larger file size and lower com- 60 | pression quality. 61 | 62 | -min_size 63 | Encode image to achieve smallest size. This disables key frame 64 | insertion and picks the dispose method resulting in smallest 65 | output for each frame. It uses lossless compression by default, 66 | but can be combined with -q, -m, -lossy or -mixed options. 67 | 68 | -kmin int 69 | 70 | -kmax int 71 | Specify the minimum and maximum distance between consecutive key 72 | frames (independently decodable frames) in the output animation. 73 | The tool will insert some key frames into the output animation 74 | as needed so that this criteria is satisfied. 75 | A 'kmax' value of 0 will turn off insertion of key frames. A 76 | 'kmax' value of 1 will result in all frames being key frames. 77 | 'kmin' value is not taken into account in both these special 78 | cases. Typical values are in the range 3 to 30. Default values 79 | are kmin = 9, kmax = 17 for lossless compression and kmin = 3, 80 | kmax = 5 for lossy compression. 81 | These two options are relevant only for animated images with 82 | large number of frames (>50). 83 | When lower values are used, more frames will be converted to key 84 | frames. This may lead to smaller number of frames required to 85 | decode a frame on average, thereby improving the decoding per- 86 | formance. But this may lead to slightly bigger file sizes. 87 | Higher values may lead to worse decoding performance, but 88 | smaller file sizes. 89 | Some restrictions: 90 | (i) kmin < kmax, 91 | (ii) kmin >= kmax / 2 + 1 and 92 | (iii) kmax - kmin <= 30. 93 | If any of these restrictions are not met, they will be enforced 94 | automatically. 95 | 96 | -metadata string 97 | A comma separated list of metadata to copy from the input to the 98 | output if present. Valid values: all, none, icc, xmp. The de- 99 | fault is xmp. 100 | 101 | -f int For lossy encoding only (specified by the -lossy option). Spec- 102 | ify the strength of the deblocking filter, between 0 (no filter- 103 | ing) and 100 (maximum filtering). A value of 0 will turn off 104 | any filtering. Higher value will increase the strength of the 105 | filtering process applied after decoding the picture. The higher 106 | the value the smoother the picture will appear. Typical values 107 | are usually in the range of 20 to 50. 108 | 109 | -mt Use multi-threading for encoding, if possible. 110 | 111 | -loop_compatibility 112 | If enabled, handle the loop information in a compatible fashion 113 | for Chrome version prior to M62 (inclusive) and Firefox. 114 | 115 | -v Print extra information. 116 | 117 | -quiet Do not print anything. 118 | 119 | 120 | BUGS 121 | Please report all bugs to the issue tracker: 122 | https://bugs.chromium.org/p/webp 123 | Patches welcome! See this page to get started: http://www.webmpro- 124 | ject.org/code/contribute/submitting-patches/ 125 | 126 | 127 | EXAMPLES 128 | gif2webp picture.gif -o picture.webp 129 | gif2webp -q 70 picture.gif -o picture.webp 130 | gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp 131 | gif2webp -lossy -f 50 picture.gif -o picture.webp 132 | gif2webp -q 70 -o picture.webp -- ---picture.gif 133 | cat picture.gif | gif2webp -o - -- - > output.webp 134 | 135 | 136 | AUTHORS 137 | gif2webp is a part of libwebp and was written by the WebP team. 138 | The latest source tree is available at https://chromium.google- 139 | source.com/webm/libwebp 140 | 141 | This manual page was written by Urvang Joshi , for 142 | the Debian project (and may be used by others). 143 | 144 | 145 | SEE ALSO 146 | cwebp(1), dwebp(1), webpmux(1) 147 | Please refer to http://developers.google.com/speed/webp/ for additional 148 | information. 149 | 150 | 151 | 152 | January 25, 2018 GIF2WEBP(1) 153 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/img2webp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | IMG2WEBP 17 | 18 | 19 | 20 | 21 |

IMG2WEBP

22 | 23 | NAME
24 | SYNOPSIS
25 | DESCRIPTION
26 | FILE-LEVEL OPTIONS
27 | PER-FRAME OPTIONS
28 | EXAMPLE
29 | BUGS
30 | AUTHORS
31 | SEE ALSO
32 | 33 |
34 | 35 | 36 |

NAME 37 | 38 |

39 | 40 | 41 |

img2webp - 42 | create animated WebP file from a sequence of input 43 | images.

44 | 45 |

SYNOPSIS 46 | 47 |

48 | 49 | 50 | 51 |

img2webp 52 | [file_level_options] [files] [per_frame_options...]
53 | img2webp argument_file_name

54 | 55 |

DESCRIPTION 56 | 57 |

58 | 59 | 60 |

This manual 61 | page documents the img2webp command.

62 | 63 | 64 |

img2webp 65 | compresses a sequence of images using the animated WebP 66 | format. Input images can either be PNG, JPEG, TIFF or WebP. 67 | If a single file name (not starting with the character 68 | ’-’) is supplied as the argument, the command 69 | line argument are actually tokenized from this file. This 70 | allows for easy scripting or using large number of 71 | arguments.

72 | 73 |

FILE-LEVEL OPTIONS 74 | 75 |

76 | 77 | 78 |

The file-level 79 | options are applied at the beginning of the compression 80 | process, before the input frames are read.
81 | -o
string

82 | 83 |

Specify the name of the output 84 | WebP file.

85 | 86 |

-min_size

87 | 88 |

Encode images to achieve 89 | smallest size. This disables key frame insertion and picks 90 | the parameters resulting in smallest output for each frame. 91 | It uses lossless compression by default, but can be combined 92 | with -q, -m, -lossy or -mixed options.

93 | 94 |

-kmin int
95 | -kmax
int

96 | 97 |

Specify the minimum and maximum 98 | distance between consecutive key frames (independently 99 | decodable frames) in the output animation. The tool will 100 | insert some key frames into the output animation as needed 101 | so that this criteria is satisfied.
102 | -mixed
Mixed compression mode: optimize compression of 103 | the image by picking either lossy or lossless compression 104 | for each frame heuristically. This global option disables 105 | the local option -lossy and -lossless .

106 | 107 |

-loop int

108 | 109 |

Specifies the number of times 110 | the animation should loop. Using ’0’ means 111 | ’loop indefinitely’.

112 | 113 | 115 | 116 | 117 | 121 | 122 | 126 | 128 |
118 | 119 | 120 |

-v

123 | 124 | 125 |

Be more verbose.

127 |
129 | 130 |

-h, -help

131 | 132 |

A short usage summary.

133 | 134 |

-version

135 | 136 |

Print the version numbers of 137 | the relevant libraries used.

138 | 139 |

PER-FRAME OPTIONS 140 | 141 |

142 | 143 | 144 |

The per-frame 145 | options are applied for the images following as arguments in 146 | the command line. They can be modified any number of times 147 | preceding each particular input image.

148 | 149 | 151 | 152 | 153 | 157 | 158 | 162 | 164 |
154 | 155 | 156 |

-d int

159 | 160 | 161 |

Specify the image duration in milliseconds.

163 |
165 | 166 |

-lossless, -lossy

167 | 168 |

Compress the next image(s) 169 | using lossless or lossy compression mode. The default mode 170 | is lossless.

171 | 172 |

-q float

173 | 174 |

Specify the compression factor 175 | between 0 and 100. The default is 75.

176 | 177 | 179 | 180 | 181 | 185 | 186 | 193 |
182 | 183 | 184 |

-m int

187 | 188 | 189 |

Specify the compression method to use. This parameter 190 | controls the trade off between encoding speed and the 191 | compressed file size and quality. Possible values range from 192 | 0 to 6. Default value is 4.

194 | 195 |

EXAMPLE 196 | 197 |

198 | 199 | 200 |

img2webp -loop 201 | 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp

202 | 203 |

BUGS 204 | 205 |

206 | 207 | 208 |

Please report 209 | all bugs to the issue tracker: 210 | https://bugs.chromium.org/p/webp
211 | Patches welcome! See this page to get started: 212 | http://www.webmproject.org/code/contribute/submitting-patches/

213 | 214 |

AUTHORS 215 | 216 |

217 | 218 | 219 | 220 |

img2webp 221 | is a part of libwebp and was written by the WebP team.
222 | The latest source tree is available at 223 | https://chromium.googlesource.com/webm/libwebp

224 | 225 |

This manual 226 | page was written by Pascal Massimino 227 | <pascal.massimino@gmail.com>, for the Debian project 228 | (and may be used by others).

229 | 230 |

SEE ALSO 231 | 232 |

233 | 234 | 235 | 236 |

webpmux(1), 237 | gif2webp(1)
238 | Please refer to http://developers.google.com/speed/webp/ for 239 | additional information.

240 |
241 | 242 | 243 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/img2webp.txt: -------------------------------------------------------------------------------- 1 | IMG2WEBP(1) General Commands Manual IMG2WEBP(1) 2 | 3 | 4 | 5 | NAME 6 | img2webp - create animated WebP file from a sequence of input images. 7 | 8 | SYNOPSIS 9 | img2webp [file_level_options] [files] [per_frame_options...] 10 | img2webp argument_file_name 11 | 12 | DESCRIPTION 13 | This manual page documents the img2webp command. 14 | 15 | img2webp compresses a sequence of images using the animated WebP for- 16 | mat. Input images can either be PNG, JPEG, TIFF or WebP. If a single 17 | file name (not starting with the character '-') is supplied as the ar- 18 | gument, the command line argument are actually tokenized from this 19 | file. This allows for easy scripting or using large number of argu- 20 | ments. 21 | 22 | FILE-LEVEL OPTIONS 23 | The file-level options are applied at the beginning of the compression 24 | process, before the input frames are read. 25 | 26 | -o string 27 | Specify the name of the output WebP file. 28 | 29 | -min_size 30 | Encode images to achieve smallest size. This disables key frame 31 | insertion and picks the parameters resulting in smallest output 32 | for each frame. It uses lossless compression by default, but can 33 | be combined with -q, -m, -lossy or -mixed options. 34 | 35 | -kmin int 36 | 37 | -kmax int 38 | Specify the minimum and maximum distance between consecutive key 39 | frames (independently decodable frames) in the output animation. 40 | The tool will insert some key frames into the output animation 41 | as needed so that this criteria is satisfied. 42 | -mixed Mixed compression mode: optimize compression of the image 43 | by picking either lossy or lossless compression for each frame 44 | heuristically. This global option disables the local option 45 | -lossy and -lossless . 46 | 47 | -loop int 48 | Specifies the number of times the animation should loop. Using 49 | '0' means 'loop indefinitely'. 50 | 51 | -v Be more verbose. 52 | 53 | -h, -help 54 | A short usage summary. 55 | 56 | -version 57 | Print the version numbers of the relevant libraries used. 58 | 59 | 60 | PER-FRAME OPTIONS 61 | The per-frame options are applied for the images following as arguments 62 | in the command line. They can be modified any number of times preceding 63 | each particular input image. 64 | 65 | -d int Specify the image duration in milliseconds. 66 | 67 | -lossless, -lossy 68 | Compress the next image(s) using lossless or lossy compression 69 | mode. The default mode is lossless. 70 | 71 | -q float 72 | Specify the compression factor between 0 and 100. The default is 73 | 75. 74 | 75 | -m int Specify the compression method to use. This parameter controls 76 | the trade off between encoding speed and the compressed file 77 | size and quality. Possible values range from 0 to 6. Default 78 | value is 4. 79 | 80 | 81 | EXAMPLE 82 | img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp 83 | 84 | 85 | BUGS 86 | Please report all bugs to the issue tracker: 87 | https://bugs.chromium.org/p/webp 88 | Patches welcome! See this page to get started: http://www.webmpro- 89 | ject.org/code/contribute/submitting-patches/ 90 | 91 | 92 | AUTHORS 93 | img2webp is a part of libwebp and was written by the WebP team. 94 | The latest source tree is available at https://chromium.google- 95 | source.com/webm/libwebp 96 | 97 | This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). 99 | 100 | 101 | SEE ALSO 102 | webpmux(1), gif2webp(1) 103 | Please refer to http://developers.google.com/speed/webp/ for additional 104 | information. 105 | 106 | 107 | 108 | April 3, 2018 IMG2WEBP(1) 109 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/vwebp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | VWEBP 17 | 18 | 19 | 20 | 21 |

VWEBP

22 | 23 | NAME
24 | SYNOPSIS
25 | DESCRIPTION
26 | OPTIONS
27 | KEYBOARD SHORTCUTS
28 | BUGS
29 | EXAMPLES
30 | AUTHORS
31 | SEE ALSO
32 | 33 |
34 | 35 | 36 |

NAME 37 | 38 |

39 | 40 | 41 |

vwebp - 42 | decompress a WebP file and display it in a window

43 | 44 |

SYNOPSIS 45 | 46 |

47 | 48 | 49 |

vwebp 50 | [options] input_file.webp

51 | 52 |

DESCRIPTION 53 | 54 |

55 | 56 | 57 |

This manual 58 | page documents the vwebp command.

59 | 60 |

vwebp 61 | decompresses a WebP file and displays it in a window using 62 | OpenGL.

63 | 64 |

OPTIONS 65 | 66 |

67 | 68 | 69 | 71 | 72 | 73 | 77 | 78 | 82 | 84 |
74 | 75 | 76 |

-h

79 | 80 | 81 |

Print usage summary.

83 |
85 | 86 |

-version

87 | 88 |

Print version number and 89 | exit.

90 | 91 | 93 | 94 | 95 | 99 | 100 | 104 | 106 |
96 | 97 | 98 |

-noicc

101 | 102 | 103 |

Don’t use the ICC profile if present.

105 |
107 | 108 |

-nofancy

109 | 110 |

Don’t use the fancy 111 | YUV420 upscaler.

112 | 113 |

-nofilter

114 | 115 |

Disable in-loop filtering.

116 | 117 |

-dither 118 | strength

119 | 120 |

Specify a dithering 121 | strength between 0 and 100. Dithering is a 122 | post-processing effect applied to chroma components in lossy 123 | compression. It helps by smoothing gradients and avoiding 124 | banding artifacts. Default: 50.

125 | 126 |

-noalphadither

127 | 128 |

By default, quantized 129 | transparency planes are dithered during decompression, to 130 | smooth the gradients. This flag will prevent this 131 | dithering.

132 | 133 |

-usebgcolor

134 | 135 |

Fill transparent areas with the 136 | bitstream’s own background color instead of 137 | checkerboard only. Default is white for non-animated 138 | images.

139 | 140 | 142 | 143 | 144 | 148 | 149 | 153 | 154 | 155 | 159 | 160 | 165 |
145 | 146 | 147 |

-mt

150 | 151 | 152 |

Use multi-threading for decoding, if possible.

156 | 157 | 158 |

-info

161 | 162 | 163 |

Display image information on top of the decoded 164 | image.

166 | 167 |

-- string

168 | 169 |

Explicitly specify the input 170 | file. This option is useful if the input file starts with an 171 | ’-’ for instance. This option must appear 172 | last. Any other options afterward will be ignored. If 173 | the input file is "-", the data will be read from 174 | stdin instead of a file.

175 | 176 |

KEYBOARD SHORTCUTS 177 | 178 |

179 | 180 | 181 | 183 | 184 | 185 | 189 | 190 | 194 | 195 | 196 | 200 | 201 | 205 | 206 | 207 | 211 | 212 | 216 | 217 | 218 | 222 | 223 | 228 |
186 | 187 | 188 |

’c’

191 | 192 | 193 |

Toggle use of color profile.

197 | 198 | 199 |

’b’

202 | 203 | 204 |

Toggle display of background color.

208 | 209 | 210 |

’i’

213 | 214 | 215 |

Overlay file information.

219 | 220 | 221 |

’d’

224 | 225 | 226 |

Disable blending and disposal process, for debugging 227 | purposes.

229 | 230 |

’q’ / 231 | ’Q’ / ESC

232 | 233 |

Quit.

234 | 235 |

BUGS 236 | 237 |

238 | 239 | 240 |

Please report 241 | all bugs to the issue tracker: 242 | https://bugs.chromium.org/p/webp
243 | Patches welcome! See this page to get started: 244 | http://www.webmproject.org/code/contribute/submitting-patches/

245 | 246 |

EXAMPLES 247 | 248 |

249 | 250 | 251 |

vwebp 252 | picture.webp
253 | vwebp picture.webp -mt -dither 0
254 | vwebp -- ---picture.webp

255 | 256 |

AUTHORS 257 | 258 |

259 | 260 | 261 |

vwebp is 262 | a part of libwebp and was written by the WebP team.
263 | The latest source tree is available at 264 | https://chromium.googlesource.com/webm/libwebp

265 | 266 |

This manual 267 | page was written for the Debian project (and may be used by 268 | others).

269 | 270 |

SEE ALSO 271 | 272 |

273 | 274 | 275 | 276 |

dwebp(1) 277 |
278 | Please refer to http://developers.google.com/speed/webp/ for 279 | additional information.

280 |
281 | 282 | 283 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/vwebp.txt: -------------------------------------------------------------------------------- 1 | VWEBP(1) General Commands Manual VWEBP(1) 2 | 3 | 4 | 5 | NAME 6 | vwebp - decompress a WebP file and display it in a window 7 | 8 | SYNOPSIS 9 | vwebp [options] input_file.webp 10 | 11 | DESCRIPTION 12 | This manual page documents the vwebp command. 13 | 14 | vwebp decompresses a WebP file and displays it in a window using 15 | OpenGL. 16 | 17 | OPTIONS 18 | -h Print usage summary. 19 | 20 | -version 21 | Print version number and exit. 22 | 23 | -noicc Don't use the ICC profile if present. 24 | 25 | -nofancy 26 | Don't use the fancy YUV420 upscaler. 27 | 28 | -nofilter 29 | Disable in-loop filtering. 30 | 31 | -dither strength 32 | Specify a dithering strength between 0 and 100. Dithering is a 33 | post-processing effect applied to chroma components in lossy 34 | compression. It helps by smoothing gradients and avoiding band- 35 | ing artifacts. Default: 50. 36 | 37 | -noalphadither 38 | By default, quantized transparency planes are dithered during 39 | decompression, to smooth the gradients. This flag will prevent 40 | this dithering. 41 | 42 | -usebgcolor 43 | Fill transparent areas with the bitstream's own background color 44 | instead of checkerboard only. Default is white for non-animated 45 | images. 46 | 47 | -mt Use multi-threading for decoding, if possible. 48 | 49 | -info Display image information on top of the decoded image. 50 | 51 | -- string 52 | Explicitly specify the input file. This option is useful if the 53 | input file starts with an '-' for instance. This option must ap- 54 | pear last. Any other options afterward will be ignored. If the 55 | input file is "-", the data will be read from stdin instead of a 56 | file. 57 | 58 | 59 | 60 | KEYBOARD SHORTCUTS 61 | 62 | 'c' Toggle use of color profile. 63 | 64 | 'b' Toggle display of background color. 65 | 66 | 'i' Overlay file information. 67 | 68 | 'd' Disable blending and disposal process, for debugging purposes. 69 | 70 | 'q' / 'Q' / ESC 71 | Quit. 72 | 73 | 74 | BUGS 75 | Please report all bugs to the issue tracker: 76 | https://bugs.chromium.org/p/webp 77 | Patches welcome! See this page to get started: http://www.webmpro- 78 | ject.org/code/contribute/submitting-patches/ 79 | 80 | 81 | EXAMPLES 82 | vwebp picture.webp 83 | vwebp picture.webp -mt -dither 0 84 | vwebp -- ---picture.webp 85 | 86 | 87 | AUTHORS 88 | vwebp is a part of libwebp and was written by the WebP team. 89 | The latest source tree is available at https://chromium.google- 90 | source.com/webm/libwebp 91 | 92 | This manual page was written for the Debian project (and may be used by 93 | others). 94 | 95 | 96 | SEE ALSO 97 | dwebp(1) 98 | Please refer to http://developers.google.com/speed/webp/ for additional 99 | information. 100 | 101 | 102 | 103 | June 5, 2019 VWEBP(1) 104 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/webpinfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | WEBPINFO 17 | 18 | 19 | 20 | 21 |

WEBPINFO

22 | 23 | NAME
24 | SYNOPSIS
25 | DESCRIPTION
26 | OPTIONS
27 | INPUT
28 | BUGS
29 | EXAMPLES
30 | AUTHORS
31 | SEE ALSO
32 | 33 |
34 | 35 | 36 |

NAME 37 | 38 |

39 | 40 | 41 |

webpinfo - 42 | print out the chunk level structure of WebP files along with 43 | basic integrity checks.

44 | 45 |

SYNOPSIS 46 | 47 |

48 | 49 | 50 | 51 |

webpinfo 52 | OPTIONS INPUT
53 | webpinfo [-h|-help|-H|-longhelp]

54 | 55 |

DESCRIPTION 56 | 57 |

58 | 59 | 60 |

This manual 61 | page documents the webpinfo command.

62 | 63 | 64 |

webpinfo 65 | can be used to print out the chunk level structure and 66 | bitstream header information of WebP files. It can also 67 | check if the files are of valid WebP format.

68 | 69 |

OPTIONS 70 | 71 |

72 | 73 | 74 | 75 |

-version

76 | 77 |

Print the version number (as 78 | major.minor.revision) and exit.

79 | 80 | 82 | 83 | 84 | 88 | 89 | 93 | 95 | 96 | 97 | 101 | 102 | 106 | 108 |
85 | 86 | 87 |

-quiet

90 | 91 | 92 |

Do not show chunk parsing information.

94 |
98 | 99 | 100 |

-diag

103 | 104 | 105 |

Show parsing error diagnosis.

107 |
109 | 110 |

-summary

111 | 112 |

Show chunk stats summary.

113 | 114 |

-bitstream_info

115 | 116 |

Parse bitstream header.

117 | 118 |

-h, -help

119 | 120 |

A short usage summary.

121 | 122 |

-H, -longhelp

123 | 124 |

Detailed usage 125 | instructions.

126 | 127 |

INPUT 128 | 129 |

130 | 131 | 132 |

Input files in 133 | WebP format. Input files must come last, following options 134 | (if any). There can be multiple input files.

135 | 136 |

BUGS 137 | 138 |

139 | 140 | 141 |

Please report 142 | all bugs to the issue tracker: 143 | https://bugs.chromium.org/p/webp
144 | Patches welcome! See this page to get started: 145 | http://www.webmproject.org/code/contribute/submitting-patches/

146 | 147 |

EXAMPLES 148 | 149 |

150 | 151 | 152 |

webpinfo -h 153 |
154 | webpinfo -diag -summary input_file.webp
155 | webpinfo -bitstream_info input_file_1.webp input_file_2.webp 156 |
157 | webpinfo *.webp

158 | 159 |

AUTHORS 160 | 161 |

162 | 163 | 164 | 165 |

webpinfo 166 | is a part of libwebp and was written by the WebP team.
167 | The latest source tree is available at 168 | https://chromium.googlesource.com/webm/libwebp

169 | 170 |

This manual 171 | page was written by Hui Su <huisu@google.com>, for the 172 | Debian project (and may be used by others).

173 | 174 |

SEE ALSO 175 | 176 |

177 | 178 | 179 | 180 |

webpmux(1) 181 |
182 | Please refer to http://developers.google.com/speed/webp/ for 183 | additional information.

184 |
185 | 186 | 187 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/webpinfo.txt: -------------------------------------------------------------------------------- 1 | WEBPINFO(1) General Commands Manual WEBPINFO(1) 2 | 3 | 4 | 5 | NAME 6 | webpinfo - print out the chunk level structure of WebP files along with 7 | basic integrity checks. 8 | 9 | SYNOPSIS 10 | webpinfo OPTIONS INPUT 11 | webpinfo [-h|-help|-H|-longhelp] 12 | 13 | 14 | DESCRIPTION 15 | This manual page documents the webpinfo command. 16 | 17 | webpinfo can be used to print out the chunk level structure and bit- 18 | stream header information of WebP files. It can also check if the files 19 | are of valid WebP format. 20 | 21 | 22 | OPTIONS 23 | -version 24 | Print the version number (as major.minor.revision) and exit. 25 | 26 | -quiet Do not show chunk parsing information. 27 | 28 | -diag Show parsing error diagnosis. 29 | 30 | -summary 31 | Show chunk stats summary. 32 | 33 | -bitstream_info 34 | Parse bitstream header. 35 | 36 | -h, -help 37 | A short usage summary. 38 | 39 | -H, -longhelp 40 | Detailed usage instructions. 41 | 42 | 43 | INPUT 44 | Input files in WebP format. Input files must come last, following op- 45 | tions (if any). There can be multiple input files. 46 | 47 | 48 | BUGS 49 | Please report all bugs to the issue tracker: 50 | https://bugs.chromium.org/p/webp 51 | Patches welcome! See this page to get started: http://www.webmpro- 52 | ject.org/code/contribute/submitting-patches/ 53 | 54 | 55 | EXAMPLES 56 | webpinfo -h 57 | webpinfo -diag -summary input_file.webp 58 | webpinfo -bitstream_info input_file_1.webp input_file_2.webp 59 | webpinfo *.webp 60 | 61 | 62 | AUTHORS 63 | webpinfo is a part of libwebp and was written by the WebP team. 64 | The latest source tree is available at https://chromium.google- 65 | source.com/webm/libwebp 66 | 67 | This manual page was written by Hui Su , for the De- 68 | bian project (and may be used by others). 69 | 70 | 71 | SEE ALSO 72 | webpmux(1) 73 | Please refer to http://developers.google.com/speed/webp/ for additional 74 | information. 75 | 76 | 77 | 78 | November 24, 2017 WEBPINFO(1) 79 | -------------------------------------------------------------------------------- /lib/libwebp_linux/doc/webpmux.txt: -------------------------------------------------------------------------------- 1 | WEBPMUX(1) General Commands Manual WEBPMUX(1) 2 | 3 | 4 | 5 | NAME 6 | webpmux - create animated WebP files from non-animated WebP images, ex- 7 | tract frames from animated WebP images, and manage XMP/EXIF metadata 8 | and ICC profile. 9 | 10 | SYNOPSIS 11 | webpmux -get GET_OPTIONS INPUT -o OUTPUT 12 | webpmux -set SET_OPTIONS INPUT -o OUTPUT 13 | webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT 14 | webpmux -frame FRAME_OPTIONS [ -frame ... ] [ -loop LOOP_COUNT ] 15 | [ -bgcolor BACKGROUND_COLOR ] -o OUTPUT 16 | webpmux -duration DURATION OPTIONS [ -duration ... ] INPUT -o OUTPUT 17 | webpmux -info INPUT 18 | webpmux [-h|-help] 19 | webpmux -version 20 | webpmux argument_file_name 21 | 22 | DESCRIPTION 23 | This manual page documents the webpmux command. 24 | 25 | webpmux can be used to create/extract from animated WebP files, as well 26 | as to add/extract/strip XMP/EXIF metadata and ICC profile. If a single 27 | file name (not starting with the character '-') is supplied as the ar- 28 | gument, the command line arguments are actually tokenized from this 29 | file. This allows for easy scripting or using large number of argu- 30 | ments. 31 | 32 | OPTIONS 33 | GET_OPTIONS (-get): 34 | icc Get ICC profile. 35 | 36 | exif Get EXIF metadata. 37 | 38 | xmp Get XMP metadata. 39 | 40 | frame n 41 | Get nth frame from an animated image. (n = 0 has a special mean- 42 | ing: last frame). 43 | 44 | 45 | SET_OPTIONS (-set) 46 | icc file.icc 47 | Set ICC profile. 48 | 49 | Where: 'file.icc' contains the ICC profile to be set. 50 | 51 | exif file.exif 52 | Set EXIF metadata. 53 | 54 | Where: 'file.exif' contains the EXIF metadata to be set. 55 | 56 | xmp file.xmp 57 | Set XMP metadata. 58 | 59 | Where: 'file.xmp' contains the XMP metadata to be set. 60 | 61 | 62 | STRIP_OPTIONS (-strip) 63 | icc Strip ICC profile. 64 | 65 | exif Strip EXIF metadata. 66 | 67 | xmp Strip XMP metadata. 68 | 69 | 70 | DURATION_OPTIONS (-duration) 71 | Amend the duration of a specific interval of frames. This option is 72 | only effective on animated WebP and has no effect on a single-frame 73 | file. 74 | 75 | duration[,start[,end]] 76 | Where: 77 | duration is the duration for the interval in milliseconds 78 | (mandatory). Must be non-negative. 79 | start is the starting frame index of the interval (optional). 80 | end is the ending frame index (inclusive) of the interval (op- 81 | tional). 82 | 83 | The three typical usages of this option are: 84 | -duration d 85 | set the duration to 'd' for the whole animation. 86 | -duration d,f 87 | set the duration of frame 'f' to 'd'. 88 | -duration d,start,end 89 | set the duration to 'd' for the whole [start,end] interval. 90 | 91 | 92 | Note that the frames outside of the [start, end] interval will 93 | remain untouched. 94 | The 'end' value '0' has the special meaning 'last frame of the 95 | animation'. 96 | 97 | Reminder: 98 | frame indexing starts at '1'. 99 | 100 | 101 | FRAME_OPTIONS (-frame) 102 | Create an animated WebP file from multiple (non-animated) WebP images. 103 | 104 | file_i +di[+xi+yi[+mi[bi]]] 105 | Where: 'file_i' is the i'th frame (WebP format), 'xi','yi' spec- 106 | ify the image offset for this frame, 'di' is the pause duration 107 | before next frame, 'mi' is the dispose method for this frame (0 108 | for NONE or 1 for BACKGROUND) and 'bi' is the blending method 109 | for this frame (+b for BLEND or -b for NO_BLEND). Argument 'bi' 110 | can be omitted and will default to +b (BLEND). Also, 'mi' can 111 | be omitted if 'bi' is omitted and will default to 0 (NONE). Fi- 112 | nally, if 'mi' and 'bi' are omitted then 'xi' and 'yi' can be 113 | omitted and will default to +0+0. 114 | 115 | -loop n 116 | Loop the frames n number of times. 0 indicates the frames should 117 | loop forever. Valid range is 0 to 65535 [Default: 0 (infi- 118 | nite)]. 119 | 120 | -bgcolor A,R,G,B 121 | Background color of the canvas. 122 | where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 123 | specifying the Alpha, Red, Green and Blue component values re- 124 | spectively [Default: 255,255,255,255]. 125 | 126 | 127 | INPUT 128 | Input file in WebP format. 129 | 130 | 131 | OUTPUT (-o) 132 | Output file in WebP format. 133 | 134 | 135 | Note: 136 | The nature of EXIF, XMP and ICC data is not checked and is assumed to 137 | be valid. 138 | 139 | 140 | BUGS 141 | Please report all bugs to the issue tracker: 142 | https://bugs.chromium.org/p/webp 143 | Patches welcome! See this page to get started: http://www.webmpro- 144 | ject.org/code/contribute/submitting-patches/ 145 | 146 | 147 | EXAMPLES 148 | Add ICC profile: 149 | webpmux -set icc image_profile.icc in.webp -o icc_container.webp 150 | 151 | Extract ICC profile: 152 | webpmux -get icc icc_container.webp -o image_profile.icc 153 | 154 | Strip ICC profile: 155 | webpmux -strip icc icc_container.webp -o without_icc.webp 156 | 157 | Add XMP metadata: 158 | webpmux -set xmp image_metadata.xmp in.webp -o xmp_container.webp 159 | 160 | Extract XMP metadata: 161 | webpmux -get xmp xmp_container.webp -o image_metadata.xmp 162 | 163 | Strip XMP metadata: 164 | webpmux -strip xmp xmp_container.webp -o without_xmp.webp 165 | 166 | Add EXIF metadata: 167 | webpmux -set exif image_metadata.exif in.webp -o exif_container.webp 168 | 169 | Extract EXIF metadata: 170 | webpmux -get exif exif_container.webp -o image_metadata.exif 171 | 172 | Strip EXIF metadata: 173 | webpmux -strip exif exif_container.webp -o without_exif.webp 174 | 175 | Create an animated WebP file from 3 (non-animated) WebP images: 176 | webpmux -frame 1.webp +100 -frame 2.webp +100+50+50 177 | -frame 3.webp +100+50+50+1+b -loop 10 -bgcolor 255,255,255,255 178 | -o anim_container.webp 179 | 180 | Get the 2nd frame from an animated WebP file: 181 | webpmux -get frame 2 anim_container.webp -o frame_2.webp 182 | 183 | Using -get/-set/-strip with input file name starting with '-': 184 | webpmux -set icc image_profile.icc -o icc_container.webp -- ---in.webp 185 | webpmux -get icc -o image_profile.icc -- ---icc_container.webp 186 | webpmux -strip icc -o without_icc.webp -- ---icc_container.webp 187 | 188 | 189 | AUTHORS 190 | webpmux is a part of libwebp and was written by the WebP team. 191 | The latest source tree is available at https://chromium.google- 192 | source.com/webm/libwebp 193 | 194 | This manual page was written by Vikas Arora , 195 | for the Debian project (and may be used by others). 196 | 197 | 198 | SEE ALSO 199 | cwebp(1), dwebp(1), gif2webp(1) 200 | Please refer to http://developers.google.com/speed/webp/ for additional 201 | information. 202 | 203 | 204 | 205 | April 23, 2018 WEBPMUX(1) 206 | -------------------------------------------------------------------------------- /lib/libwebp_linux/include/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/include/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_linux/include/webp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/include/webp/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_linux/include/webp/mux_types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the COPYING file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | // ----------------------------------------------------------------------------- 9 | // 10 | // Data-types common to the mux and demux libraries. 11 | // 12 | // Author: Urvang (urvang@google.com) 13 | 14 | #ifndef WEBP_WEBP_MUX_TYPES_H_ 15 | #define WEBP_WEBP_MUX_TYPES_H_ 16 | 17 | #include // memset() 18 | #include "./types.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | // Note: forward declaring enumerations is not allowed in (strict) C and C++, 25 | // the types are left here for reference. 26 | // typedef enum WebPFeatureFlags WebPFeatureFlags; 27 | // typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; 28 | // typedef enum WebPMuxAnimBlend WebPMuxAnimBlend; 29 | typedef struct WebPData WebPData; 30 | 31 | // VP8X Feature Flags. 32 | typedef enum WebPFeatureFlags { 33 | ANIMATION_FLAG = 0x00000002, 34 | XMP_FLAG = 0x00000004, 35 | EXIF_FLAG = 0x00000008, 36 | ALPHA_FLAG = 0x00000010, 37 | ICCP_FLAG = 0x00000020, 38 | 39 | ALL_VALID_FLAGS = 0x0000003e 40 | } WebPFeatureFlags; 41 | 42 | // Dispose method (animation only). Indicates how the area used by the current 43 | // frame is to be treated before rendering the next frame on the canvas. 44 | typedef enum WebPMuxAnimDispose { 45 | WEBP_MUX_DISPOSE_NONE, // Do not dispose. 46 | WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. 47 | } WebPMuxAnimDispose; 48 | 49 | // Blend operation (animation only). Indicates how transparent pixels of the 50 | // current frame are blended with those of the previous canvas. 51 | typedef enum WebPMuxAnimBlend { 52 | WEBP_MUX_BLEND, // Blend. 53 | WEBP_MUX_NO_BLEND // Do not blend. 54 | } WebPMuxAnimBlend; 55 | 56 | // Data type used to describe 'raw' data, e.g., chunk data 57 | // (ICC profile, metadata) and WebP compressed image data. 58 | // 'bytes' memory must be allocated using WebPMalloc() and such. 59 | struct WebPData { 60 | const uint8_t* bytes; 61 | size_t size; 62 | }; 63 | 64 | // Initializes the contents of the 'webp_data' object with default values. 65 | static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { 66 | if (webp_data != NULL) { 67 | memset(webp_data, 0, sizeof(*webp_data)); 68 | } 69 | } 70 | 71 | // Clears the contents of the 'webp_data' object by calling WebPFree(). 72 | // Does not deallocate the object itself. 73 | static WEBP_INLINE void WebPDataClear(WebPData* webp_data) { 74 | if (webp_data != NULL) { 75 | WebPFree((void*)webp_data->bytes); 76 | WebPDataInit(webp_data); 77 | } 78 | } 79 | 80 | // Allocates necessary storage for 'dst' and copies the contents of 'src'. 81 | // Returns true on success. 82 | static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) { 83 | if (src == NULL || dst == NULL) return 0; 84 | WebPDataInit(dst); 85 | if (src->bytes != NULL && src->size != 0) { 86 | dst->bytes = (uint8_t*)WebPMalloc(src->size); 87 | if (dst->bytes == NULL) return 0; 88 | memcpy((void*)dst->bytes, src->bytes, src->size); 89 | dst->size = src->size; 90 | } 91 | return 1; 92 | } 93 | 94 | #ifdef __cplusplus 95 | } // extern "C" 96 | #endif 97 | 98 | #endif // WEBP_WEBP_MUX_TYPES_H_ 99 | -------------------------------------------------------------------------------- /lib/libwebp_linux/include/webp/types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010 Google Inc. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the COPYING file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | // ----------------------------------------------------------------------------- 9 | // 10 | // Common types + memory wrappers 11 | // 12 | // Author: Skal (pascal.massimino@gmail.com) 13 | 14 | #ifndef WEBP_WEBP_TYPES_H_ 15 | #define WEBP_WEBP_TYPES_H_ 16 | 17 | #include // for size_t 18 | 19 | #ifndef _MSC_VER 20 | #include 21 | #if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ 22 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) 23 | #define WEBP_INLINE inline 24 | #else 25 | #define WEBP_INLINE 26 | #endif 27 | #else 28 | typedef signed char int8_t; 29 | typedef unsigned char uint8_t; 30 | typedef signed short int16_t; 31 | typedef unsigned short uint16_t; 32 | typedef signed int int32_t; 33 | typedef unsigned int uint32_t; 34 | typedef unsigned long long int uint64_t; 35 | typedef long long int int64_t; 36 | #define WEBP_INLINE __forceinline 37 | #endif /* _MSC_VER */ 38 | 39 | #ifndef WEBP_EXTERN 40 | // This explicitly marks library functions and allows for changing the 41 | // signature for e.g., Windows DLL builds. 42 | # if defined(__GNUC__) && __GNUC__ >= 4 43 | # define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) 44 | # else 45 | # define WEBP_EXTERN extern 46 | # endif /* __GNUC__ >= 4 */ 47 | #endif /* WEBP_EXTERN */ 48 | 49 | // Macro to check ABI compatibility (same major revision number) 50 | #define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | // Allocates 'size' bytes of memory. Returns NULL upon error. Memory 57 | // must be deallocated by calling WebPFree(). This function is made available 58 | // by the core 'libwebp' library. 59 | WEBP_EXTERN void* WebPMalloc(size_t size); 60 | 61 | // Releases memory returned by the WebPDecode*() functions (from decode.h). 62 | WEBP_EXTERN void WebPFree(void* ptr); 63 | 64 | #ifdef __cplusplus 65 | } // extern "C" 66 | #endif 67 | 68 | #endif // WEBP_WEBP_TYPES_H_ 69 | -------------------------------------------------------------------------------- /lib/libwebp_linux/lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/lib/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_linux/lib/libwebp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/lib/libwebp.a -------------------------------------------------------------------------------- /lib/libwebp_linux/lib/libwebpdemux.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/lib/libwebpdemux.a -------------------------------------------------------------------------------- /lib/libwebp_linux/lib/libwebpmux.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_linux/lib/libwebpmux.a -------------------------------------------------------------------------------- /lib/libwebp_osx/README.mux: -------------------------------------------------------------------------------- 1 |  __ __ ____ ____ ____ __ __ _ __ __ 2 | / \\/ \/ _ \/ _ \/ _ \/ \ \/ \___/_ / _\ 3 | \ / __/ _ \ __/ / / (_/ /__ 4 | \__\__/\_____/_____/__/ \__//_/\_____/__/___/v1.1.0 5 | 6 | 7 | Description: 8 | ============ 9 | 10 | WebPMux: set of two libraries 'Mux' and 'Demux' for creation, extraction and 11 | manipulation of an extended format WebP file, which can have features like 12 | color profile, metadata and animation. Reference command-line tools 'webpmux' 13 | and 'vwebp' as well as the WebP container specification 14 | 'doc/webp-container-spec.txt' are also provided in this package. 15 | 16 | WebP Mux tool: 17 | ============== 18 | 19 | The examples/ directory contains a tool (webpmux) for manipulating WebP 20 | files. The webpmux tool can be used to create an extended format WebP file and 21 | also to extract or strip relevant data from such a file. 22 | 23 | A list of options is available using the -help command line flag: 24 | 25 | > webpmux -help 26 | Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT 27 | webpmux -set SET_OPTIONS INPUT -o OUTPUT 28 | webpmux -duration DURATION_OPTIONS [-duration ...] 29 | INPUT -o OUTPUT 30 | webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT 31 | webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT] 32 | [-bgcolor BACKGROUND_COLOR] -o OUTPUT 33 | webpmux -info INPUT 34 | webpmux [-h|-help] 35 | webpmux -version 36 | webpmux argument_file_name 37 | 38 | GET_OPTIONS: 39 | Extract relevant data: 40 | icc get ICC profile 41 | exif get EXIF metadata 42 | xmp get XMP metadata 43 | frame n get nth frame 44 | 45 | SET_OPTIONS: 46 | Set color profile/metadata: 47 | icc file.icc set ICC profile 48 | exif file.exif set EXIF metadata 49 | xmp file.xmp set XMP metadata 50 | where: 'file.icc' contains the ICC profile to be set, 51 | 'file.exif' contains the EXIF metadata to be set 52 | 'file.xmp' contains the XMP metadata to be set 53 | 54 | DURATION_OPTIONS: 55 | Set duration of selected frames: 56 | duration set duration for each frames 57 | duration,frame set duration of a particular frame 58 | duration,start,end set duration of frames in the 59 | interval [start,end]) 60 | where: 'duration' is the duration in milliseconds 61 | 'start' is the start frame index 62 | 'end' is the inclusive end frame index 63 | The special 'end' value '0' means: last frame. 64 | 65 | STRIP_OPTIONS: 66 | Strip color profile/metadata: 67 | icc strip ICC profile 68 | exif strip EXIF metadata 69 | xmp strip XMP metadata 70 | 71 | FRAME_OPTIONS(i): 72 | Create animation: 73 | file_i +di+[xi+yi[+mi[bi]]] 74 | where: 'file_i' is the i'th animation frame (WebP format), 75 | 'di' is the pause duration before next frame, 76 | 'xi','yi' specify the image offset for this frame, 77 | 'mi' is the dispose method for this frame (0 or 1), 78 | 'bi' is the blending method for this frame (+b or -b) 79 | 80 | LOOP_COUNT: 81 | Number of times to repeat the animation. 82 | Valid range is 0 to 65535 [Default: 0 (infinite)]. 83 | 84 | BACKGROUND_COLOR: 85 | Background color of the canvas. 86 | A,R,G,B 87 | where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying 88 | the Alpha, Red, Green and Blue component values respectively 89 | [Default: 255,255,255,255] 90 | 91 | INPUT & OUTPUT are in WebP format. 92 | 93 | Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be 94 | valid. 95 | 96 | Note: if a single file name is passed as the argument, the arguments will be 97 | tokenized from this file. The file name must not start with the character '-'. 98 | 99 | Visualization tool: 100 | =================== 101 | 102 | The examples/ directory also contains a tool (vwebp) for viewing WebP files. 103 | It decodes the image and visualizes it using OpenGL. See the libwebp README 104 | for details on building and running this program. 105 | 106 | Mux API: 107 | ======== 108 | The Mux API contains methods for adding data to and reading data from WebP 109 | files. This API currently supports XMP/EXIF metadata, ICC profile and animation. 110 | Other features may be added in subsequent releases. 111 | 112 | Example#1 (pseudo code): Creating a WebPMux object with image data, color 113 | profile and XMP metadata. 114 | 115 | int copy_data = 0; 116 | WebPMux* mux = WebPMuxNew(); 117 | // ... (Prepare image data). 118 | WebPMuxSetImage(mux, &image, copy_data); 119 | // ... (Prepare ICC profile data). 120 | WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); 121 | // ... (Prepare XMP metadata). 122 | WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); 123 | // Get data from mux in WebP RIFF format. 124 | WebPMuxAssemble(mux, &output_data); 125 | WebPMuxDelete(mux); 126 | // ... (Consume output_data; e.g. write output_data.bytes to file). 127 | WebPDataClear(&output_data); 128 | 129 | 130 | Example#2 (pseudo code): Get image and color profile data from a WebP file. 131 | 132 | int copy_data = 0; 133 | // ... (Read data from file). 134 | WebPMux* mux = WebPMuxCreate(&data, copy_data); 135 | WebPMuxGetFrame(mux, 1, &image); 136 | // ... (Consume image; e.g. call WebPDecode() to decode the data). 137 | WebPMuxGetChunk(mux, "ICCP", &icc_profile); 138 | // ... (Consume icc_profile). 139 | WebPMuxDelete(mux); 140 | free(data); 141 | 142 | 143 | For a detailed Mux API reference, please refer to the header file 144 | (src/webp/mux.h). 145 | 146 | Demux API: 147 | ========== 148 | The Demux API enables extraction of images and extended format data from 149 | WebP files. This API currently supports reading of XMP/EXIF metadata, ICC 150 | profile and animated images. Other features may be added in subsequent 151 | releases. 152 | 153 | Code example: Demuxing WebP data to extract all the frames, ICC profile 154 | and EXIF/XMP metadata. 155 | 156 | WebPDemuxer* demux = WebPDemux(&webp_data); 157 | uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); 158 | uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); 159 | // ... (Get information about the features present in the WebP file). 160 | uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); 161 | 162 | // ... (Iterate over all frames). 163 | WebPIterator iter; 164 | if (WebPDemuxGetFrame(demux, 1, &iter)) { 165 | do { 166 | // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), 167 | // ... and get other frame properties like width, height, offsets etc. 168 | // ... see 'struct WebPIterator' below for more info). 169 | } while (WebPDemuxNextFrame(&iter)); 170 | WebPDemuxReleaseIterator(&iter); 171 | } 172 | 173 | // ... (Extract metadata). 174 | WebPChunkIterator chunk_iter; 175 | if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); 176 | // ... (Consume the ICC profile in 'chunk_iter.chunk'). 177 | WebPDemuxReleaseChunkIterator(&chunk_iter); 178 | if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); 179 | // ... (Consume the EXIF metadata in 'chunk_iter.chunk'). 180 | WebPDemuxReleaseChunkIterator(&chunk_iter); 181 | if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); 182 | // ... (Consume the XMP metadata in 'chunk_iter.chunk'). 183 | WebPDemuxReleaseChunkIterator(&chunk_iter); 184 | WebPDemuxDelete(demux); 185 | 186 | 187 | For a detailed Demux API reference, please refer to the header file 188 | (src/webp/demux.h). 189 | 190 | AnimEncoder API: 191 | ================ 192 | The AnimEncoder API can be used to create animated WebP images. 193 | 194 | Code example: 195 | 196 | WebPAnimEncoderOptions enc_options; 197 | WebPAnimEncoderOptionsInit(&enc_options); 198 | // ... (Tune 'enc_options' as needed). 199 | WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); 200 | while() { 201 | WebPConfig config; 202 | WebPConfigInit(&config); 203 | // ... (Tune 'config' as needed). 204 | WebPAnimEncoderAdd(enc, frame, duration, &config); 205 | } 206 | WebPAnimEncoderAssemble(enc, webp_data); 207 | WebPAnimEncoderDelete(enc); 208 | // ... (Write the 'webp_data' to a file, or re-mux it further). 209 | 210 | 211 | For a detailed AnimEncoder API reference, please refer to the header file 212 | (src/webp/mux.h). 213 | 214 | AnimDecoder API: 215 | ================ 216 | This AnimDecoder API allows decoding (possibly) animated WebP images. 217 | 218 | Code Example: 219 | 220 | WebPAnimDecoderOptions dec_options; 221 | WebPAnimDecoderOptionsInit(&dec_options); 222 | // Tune 'dec_options' as needed. 223 | WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); 224 | WebPAnimInfo anim_info; 225 | WebPAnimDecoderGetInfo(dec, &anim_info); 226 | for (uint32_t i = 0; i < anim_info.loop_count; ++i) { 227 | while (WebPAnimDecoderHasMoreFrames(dec)) { 228 | uint8_t* buf; 229 | int timestamp; 230 | WebPAnimDecoderGetNext(dec, &buf, ×tamp); 231 | // ... (Render 'buf' based on 'timestamp'). 232 | // ... (Do NOT free 'buf', as it is owned by 'dec'). 233 | } 234 | WebPAnimDecoderReset(dec); 235 | } 236 | const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); 237 | // ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). 238 | WebPAnimDecoderDelete(dec); 239 | 240 | For a detailed AnimDecoder API reference, please refer to the header file 241 | (src/webp/demux.h). 242 | 243 | 244 | Bugs: 245 | ===== 246 | 247 | Please report all bugs to the issue tracker: 248 | https://bugs.chromium.org/p/webp 249 | Patches welcome! See this page to get started: 250 | http://www.webmproject.org/code/contribute/submitting-patches/ 251 | 252 | Discuss: 253 | ======== 254 | 255 | Email: webp-discuss@webmproject.org 256 | Web: http://groups.google.com/a/webmproject.org/group/webp-discuss 257 | -------------------------------------------------------------------------------- /lib/libwebp_osx/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/anim_diff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/anim_diff -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/anim_dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/anim_dump -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/cwebp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/cwebp -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/dwebp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/dwebp -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/get_disto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/get_disto -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/gif2webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/gif2webp -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/img2webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/img2webp -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/vwebp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/vwebp -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/webp_quality: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/webp_quality -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/webpinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/webpinfo -------------------------------------------------------------------------------- /lib/libwebp_osx/bin/webpmux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/bin/webpmux -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/doc/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/dwebp.txt: -------------------------------------------------------------------------------- 1 | DWEBP(1) DWEBP(1) 2 | 3 | 4 | 5 | NAME 6 | dwebp - decompress a WebP file to an image file 7 | 8 | SYNOPSIS 9 | dwebp [options] input_file.webp 10 | 11 | DESCRIPTION 12 | This manual page documents the dwebp command. 13 | 14 | dwebp decompresses WebP files into PNG, PAM, PPM or PGM images. 15 | 16 | OPTIONS 17 | The basic options are: 18 | 19 | -h Print usage summary. 20 | 21 | -version 22 | Print the version number (as major.minor.revision) and exit. 23 | 24 | -o string 25 | Specify the name of the output file (as PNG format by default). 26 | Using "-" as output name will direct output to 'stdout'. 27 | 28 | -- string 29 | Explicitly specify the input file. This option is useful if the 30 | input file starts with an '-' for instance. This option must 31 | appear last. Any other options afterward will be ignored. If 32 | the input file is "-", the data will be read from stdin instead 33 | of a file. 34 | 35 | -bmp Change the output format to uncompressed BMP. 36 | 37 | -tiff Change the output format to uncompressed TIFF. 38 | 39 | -pam Change the output format to PAM (retains alpha). 40 | 41 | -ppm Change the output format to PPM (discards alpha). 42 | 43 | -pgm Change the output format to PGM. The output consists of 44 | luma/chroma samples instead of RGB, using the IMC4 layout. This 45 | option is mainly for verification and debugging purposes. 46 | 47 | -yuv Change the output format to raw YUV. The output consists of 48 | luma/chroma-U/chroma-V samples instead of RGB, saved sequen- 49 | tially as individual planes. This option is mainly for verifica- 50 | tion and debugging purposes. 51 | 52 | -nofancy 53 | Don't use the fancy upscaler for YUV420. This may lead to jaggy 54 | edges (especially the red ones), but should be faster. 55 | 56 | -nofilter 57 | Don't use the in-loop filtering process even if it is required 58 | by the bitstream. This may produce visible blocks on the non- 59 | compliant output, but it will make the decoding faster. 60 | 61 | -dither strength 62 | Specify a dithering strength between 0 and 100. Dithering is a 63 | post-processing effect applied to chroma components in lossy 64 | compression. It helps by smoothing gradients and avoiding band- 65 | ing artifacts. 66 | 67 | -alpha_dither 68 | If the compressed file contains a transparency plane that was 69 | quantized during compression, this flag will allow dithering the 70 | reconstructed plane in order to generate smoother transparency 71 | gradients. 72 | 73 | -nodither 74 | Disable all dithering (default). 75 | 76 | -mt Use multi-threading for decoding, if possible. 77 | 78 | -crop x_position y_position width height 79 | Crop the decoded picture to a rectangle with top-left corner at 80 | coordinates (x_position, y_position) and size width x height. 81 | This cropping area must be fully contained within the source 82 | rectangle. The top-left corner will be snapped to even coordi- 83 | nates if needed. This option is meant to reduce the memory 84 | needed for cropping large images. Note: the cropping is applied 85 | before any scaling. 86 | 87 | -flip Flip decoded image vertically (can be useful for OpenGL textures 88 | for instance). 89 | 90 | -resize, -scale width height 91 | Rescale the decoded picture to dimension width x height. This 92 | option is mostly intended to reducing the memory needed to 93 | decode large images, when only a small version is needed (thumb- 94 | nail, preview, etc.). Note: scaling is applied after cropping. 95 | If either (but not both) of the width or height parameters is 0, 96 | the value will be calculated preserving the aspect-ratio. 97 | 98 | -quiet Do not print anything. 99 | 100 | -v Print extra information (decoding time in particular). 101 | 102 | -noasm Disable all assembly optimizations. 103 | 104 | 105 | BUGS 106 | Please report all bugs to the issue tracker: 107 | https://bugs.chromium.org/p/webp 108 | Patches welcome! See this page to get started: http://www.webmpro- 109 | ject.org/code/contribute/submitting-patches/ 110 | 111 | 112 | EXAMPLES 113 | dwebp picture.webp -o output.png 114 | dwebp picture.webp -ppm -o output.ppm 115 | dwebp -o output.ppm -- ---picture.webp 116 | cat picture.webp | dwebp -o - -- - > output.ppm 117 | 118 | 119 | AUTHORS 120 | dwebp is a part of libwebp and was written by the WebP team. 121 | The latest source tree is available at https://chromium.google- 122 | source.com/webm/libwebp 123 | 124 | This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). 126 | 127 | 128 | SEE ALSO 129 | cwebp(1), gif2webp(1), webpmux(1) 130 | Please refer to http://developers.google.com/speed/webp/ for additional 131 | information. 132 | 133 | Output file format details 134 | PAM: http://netpbm.sourceforge.net/doc/pam.html 135 | PGM: http://netpbm.sourceforge.net/doc/pgm.html 136 | PPM: http://netpbm.sourceforge.net/doc/ppm.html 137 | PNG: http://www.libpng.org/pub/png/png-sitemap.html#info 138 | 139 | 140 | 141 | June 23, 2016 DWEBP(1) 142 | -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/gif2webp.txt: -------------------------------------------------------------------------------- 1 | GIF2WEBP(1) GIF2WEBP(1) 2 | 3 | 4 | 5 | NAME 6 | gif2webp - Convert a GIF image to WebP 7 | 8 | SYNOPSIS 9 | gif2webp [options] input_file.gif -o output_file.webp 10 | 11 | DESCRIPTION 12 | This manual page documents the gif2webp command. 13 | 14 | gif2webp converts a GIF image to a WebP image. 15 | 16 | OPTIONS 17 | The basic options are: 18 | 19 | -o string 20 | Specify the name of the output WebP file. If omitted, gif2webp 21 | will perform conversion but only report statistics. Using "-" 22 | as output name will direct output to 'stdout'. 23 | 24 | -- string 25 | Explicitly specify the input file. This option is useful if the 26 | input file starts with an '-' for instance. This option must 27 | appear last. Any other options afterward will be ignored. If 28 | the input file is "-", the data will be read from stdin instead 29 | of a file. 30 | 31 | -h, -help 32 | Usage information. 33 | 34 | -version 35 | Print the version number (as major.minor.revision) and exit. 36 | 37 | -lossy Encode the image using lossy compression. 38 | 39 | -mixed Mixed compression mode: optimize compression of the image by 40 | picking either lossy or lossless compression for each frame 41 | heuristically. 42 | 43 | -q float 44 | Specify the compression factor for RGB channels between 0 and 45 | 100. The default is 75. 46 | In case of lossless compression (default), a small factor 47 | enables faster compression speed, but produces a larger file. 48 | Maximum compression is achieved by using a value of 100. 49 | In case of lossy compression (specified by the -lossy option), a 50 | small factor produces a smaller file with lower quality. Best 51 | quality is achieved by using a value of 100. 52 | 53 | -m int Specify the compression method to use. This parameter controls 54 | the trade off between encoding speed and the compressed file 55 | size and quality. Possible values range from 0 to 6. Default 56 | value is 4. When higher values are used, the encoder will spend 57 | more time inspecting additional encoding possibilities and 58 | decide on the quality gain. Lower value can result is faster 59 | processing time at the expense of larger file size and lower 60 | compression quality. 61 | 62 | -min_size 63 | Encode image to achieve smallest size. This disables key frame 64 | insertion and picks the dispose method resulting in smallest 65 | output for each frame. It uses lossless compression by default, 66 | but can be combined with -q, -m, -lossy or -mixed options. 67 | 68 | -kmin int 69 | 70 | -kmax int 71 | Specify the minimum and maximum distance between consecutive key 72 | frames (independently decodable frames) in the output animation. 73 | The tool will insert some key frames into the output animation 74 | as needed so that this criteria is satisfied. 75 | A 'kmax' value of 0 will turn off insertion of key frames. A 76 | 'kmax' value of 1 will result in all frames being key frames. 77 | 'kmin' value is not taken into account in both these special 78 | cases. Typical values are in the range 3 to 30. Default values 79 | are kmin = 9, kmax = 17 for lossless compression and kmin = 3, 80 | kmax = 5 for lossy compression. 81 | These two options are relevant only for animated images with 82 | large number of frames (>50). 83 | When lower values are used, more frames will be converted to key 84 | frames. This may lead to smaller number of frames required to 85 | decode a frame on average, thereby improving the decoding per- 86 | formance. But this may lead to slightly bigger file sizes. 87 | Higher values may lead to worse decoding performance, but 88 | smaller file sizes. 89 | Some restrictions: 90 | (i) kmin < kmax, 91 | (ii) kmin >= kmax / 2 + 1 and 92 | (iii) kmax - kmin <= 30. 93 | If any of these restrictions are not met, they will be enforced 94 | automatically. 95 | 96 | -metadata string 97 | A comma separated list of metadata to copy from the input to the 98 | output if present. Valid values: all, none, icc, xmp. The 99 | default is xmp. 100 | 101 | -f int For lossy encoding only (specified by the -lossy option). Spec- 102 | ify the strength of the deblocking filter, between 0 (no filter- 103 | ing) and 100 (maximum filtering). A value of 0 will turn off 104 | any filtering. Higher value will increase the strength of the 105 | filtering process applied after decoding the picture. The higher 106 | the value the smoother the picture will appear. Typical values 107 | are usually in the range of 20 to 50. 108 | 109 | -mt Use multi-threading for encoding, if possible. 110 | 111 | -loop_compatibility 112 | If enabled, handle the loop information in a compatible fashion 113 | for Chrome version prior to M62 (inclusive) and Firefox. 114 | 115 | -v Print extra information. 116 | 117 | -quiet Do not print anything. 118 | 119 | 120 | BUGS 121 | Please report all bugs to the issue tracker: 122 | https://bugs.chromium.org/p/webp 123 | Patches welcome! See this page to get started: http://www.webmpro- 124 | ject.org/code/contribute/submitting-patches/ 125 | 126 | 127 | EXAMPLES 128 | gif2webp picture.gif -o picture.webp 129 | gif2webp -q 70 picture.gif -o picture.webp 130 | gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp 131 | gif2webp -lossy -f 50 picture.gif -o picture.webp 132 | gif2webp -q 70 -o picture.webp -- ---picture.gif 133 | cat picture.gif | gif2webp -o - -- - > output.webp 134 | 135 | 136 | AUTHORS 137 | gif2webp is a part of libwebp and was written by the WebP team. 138 | The latest source tree is available at https://chromium.google- 139 | source.com/webm/libwebp 140 | 141 | This manual page was written by Urvang Joshi , for 142 | the Debian project (and may be used by others). 143 | 144 | 145 | SEE ALSO 146 | cwebp(1), dwebp(1), webpmux(1) 147 | Please refer to http://developers.google.com/speed/webp/ for additional 148 | information. 149 | 150 | 151 | 152 | January 25, 2018 GIF2WEBP(1) 153 | -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/img2webp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | IMG2WEBP 16 | 17 | 18 | 19 | 20 |

IMG2WEBP

21 | 22 | NAME
23 | SYNOPSIS
24 | DESCRIPTION
25 | FILE-LEVEL OPTIONS
26 | PER-FRAME OPTIONS
27 | EXAMPLE
28 | BUGS
29 | AUTHORS
30 | SEE ALSO
31 | 32 |
33 | 34 | 35 | 36 |

NAME

37 | 38 | 39 |

img2webp 40 | − create animated WebP file from a sequence of input 41 | images.

42 | 43 | 44 |

SYNOPSIS

45 | 46 | 47 | 48 |

img2webp 49 | [file_level_options] [files] [per_frame_options...]
50 | img2webp argument_file_name

51 | 52 | 53 |

DESCRIPTION

54 | 55 | 56 |

This manual 57 | page documents the img2webp command.

58 | 59 | 60 |

img2webp 61 | compresses a sequence of images using the animated WebP 62 | format. Input images can either be PNG, JPEG, TIFF or WebP. 63 | If a single file name (not starting with the character 64 | ’−’) is supplied as the argument, the 65 | command line argument are actually tokenized from this file. 66 | This allows for easy scripting or using large number of 67 | arguments.

68 | 69 | 70 |

FILE-LEVEL OPTIONS

71 | 72 | 73 |

The file-level 74 | options are applied at the beginning of the compression 75 | process, before the input frames are read.
76 | −o
string

77 | 78 |

Specify the name of the output 79 | WebP file.

80 | 81 |

−min_size

82 | 83 |

Encode images to achieve 84 | smallest size. This disables key frame insertion and picks 85 | the parameters resulting in smallest output for each frame. 86 | It uses lossless compression by default, but can be combined 87 | with −q, −m, −lossy or −mixed 88 | options.

89 | 90 |

−kmin int 91 |
92 | −kmax
int

93 | 94 |

Specify the minimum and maximum 95 | distance between consecutive key frames (independently 96 | decodable frames) in the output animation. The tool will 97 | insert some key frames into the output animation as needed 98 | so that this criteria is satisfied.
99 | −mixed
Mixed compression mode: optimize 100 | compression of the image by picking either lossy or lossless 101 | compression for each frame heuristically. This global option 102 | disables the local option -lossy and -lossless 103 | .

104 | 105 |

−loop 106 | int

107 | 108 |

Specifies the number of times 109 | the animation should loop. Using ’0’ means 110 | ’loop indefinitely’.

111 | 112 | 114 | 115 | 116 | 121 | 122 | 127 | 129 |
117 | 118 | 119 | 120 |

−v

123 | 124 | 125 |

Be more 126 | verbose.

128 |
130 | 131 |

−h, 132 | −help

133 | 134 |

A short usage summary.

135 | 136 |

−version

137 | 138 |

Print the version numbers of 139 | the relevant libraries used.

140 | 141 | 142 |

PER-FRAME OPTIONS

143 | 144 | 145 |

The per-frame 146 | options are applied for the images following as arguments in 147 | the command line. They can be modified any number of times 148 | preceding each particular input image.

149 | 150 | 152 | 153 | 154 | 159 | 160 | 165 | 167 |
155 | 156 | 157 |

−d 158 | int

161 | 162 | 163 |

Specify the image 164 | duration in milliseconds.

166 |
168 | 169 |

−lossless, 170 | −lossy

171 | 172 |

Compress the next image(s) 173 | using lossless or lossy compression mode. The default mode 174 | is lossless.

175 | 176 |

−q 177 | float

178 | 179 |

Specify the compression factor 180 | between 0 and 100. The default is 75.

181 | 182 | 184 | 185 | 186 | 191 | 192 | 200 |
187 | 188 | 189 |

−m 190 | int

193 | 194 | 195 |

Specify the 196 | compression method to use. This parameter controls the trade 197 | off between encoding speed and the compressed file size and 198 | quality. Possible values range from 0 to 6. Default value is 199 | 4.

201 | 202 | 203 |

EXAMPLE

204 | 205 | 206 |

img2webp -loop 207 | 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp

208 | 209 | 210 |

BUGS

211 | 212 | 213 |

Please report 214 | all bugs to the issue tracker: 215 | https://bugs.chromium.org/p/webp
216 | Patches welcome! See this page to get started: 217 | http://www.webmproject.org/code/contribute/submitting−patches/

218 | 219 | 220 |

AUTHORS

221 | 222 | 223 | 224 |

img2webp 225 | is a part of libwebp and was written by the WebP team.
226 | The latest source tree is available at 227 | https://chromium.googlesource.com/webm/libwebp

228 | 229 |

This manual 230 | page was written by Pascal Massimino 231 | <pascal.massimino@gmail.com>, for the Debian project 232 | (and may be used by others).

233 | 234 | 235 |

SEE ALSO

236 | 237 | 238 | 239 |

webpmux(1), 240 | gif2webp(1)
241 | Please refer to http://developers.google.com/speed/webp/ for 242 | additional information.

243 |
244 | 245 | 246 | -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/img2webp.txt: -------------------------------------------------------------------------------- 1 | IMG2WEBP(1) IMG2WEBP(1) 2 | 3 | 4 | 5 | NAME 6 | img2webp - create animated WebP file from a sequence of input images. 7 | 8 | SYNOPSIS 9 | img2webp [file_level_options] [files] [per_frame_options...] 10 | img2webp argument_file_name 11 | 12 | DESCRIPTION 13 | This manual page documents the img2webp command. 14 | 15 | img2webp compresses a sequence of images using the animated WebP for- 16 | mat. Input images can either be PNG, JPEG, TIFF or WebP. If a single 17 | file name (not starting with the character '-') is supplied as the 18 | argument, the command line argument are actually tokenized from this 19 | file. This allows for easy scripting or using large number of argu- 20 | ments. 21 | 22 | FILE-LEVEL OPTIONS 23 | The file-level options are applied at the beginning of the compression 24 | process, before the input frames are read. 25 | 26 | -o string 27 | Specify the name of the output WebP file. 28 | 29 | -min_size 30 | Encode images to achieve smallest size. This disables key frame 31 | insertion and picks the parameters resulting in smallest output 32 | for each frame. It uses lossless compression by default, but can 33 | be combined with -q, -m, -lossy or -mixed options. 34 | 35 | -kmin int 36 | 37 | -kmax int 38 | Specify the minimum and maximum distance between consecutive key 39 | frames (independently decodable frames) in the output animation. 40 | The tool will insert some key frames into the output animation 41 | as needed so that this criteria is satisfied. 42 | -mixed Mixed compression mode: optimize compression of the image 43 | by picking either lossy or lossless compression for each frame 44 | heuristically. This global option disables the local option 45 | -lossy and -lossless . 46 | 47 | -loop int 48 | Specifies the number of times the animation should loop. Using 49 | '0' means 'loop indefinitely'. 50 | 51 | -v Be more verbose. 52 | 53 | -h, -help 54 | A short usage summary. 55 | 56 | -version 57 | Print the version numbers of the relevant libraries used. 58 | 59 | 60 | PER-FRAME OPTIONS 61 | The per-frame options are applied for the images following as arguments 62 | in the command line. They can be modified any number of times preceding 63 | each particular input image. 64 | 65 | -d int Specify the image duration in milliseconds. 66 | 67 | -lossless, -lossy 68 | Compress the next image(s) using lossless or lossy compression 69 | mode. The default mode is lossless. 70 | 71 | -q float 72 | Specify the compression factor between 0 and 100. The default is 73 | 75. 74 | 75 | -m int Specify the compression method to use. This parameter controls 76 | the trade off between encoding speed and the compressed file 77 | size and quality. Possible values range from 0 to 6. Default 78 | value is 4. 79 | 80 | 81 | EXAMPLE 82 | img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp 83 | 84 | 85 | BUGS 86 | Please report all bugs to the issue tracker: 87 | https://bugs.chromium.org/p/webp 88 | Patches welcome! See this page to get started: http://www.webmpro- 89 | ject.org/code/contribute/submitting-patches/ 90 | 91 | 92 | AUTHORS 93 | img2webp is a part of libwebp and was written by the WebP team. 94 | The latest source tree is available at https://chromium.google- 95 | source.com/webm/libwebp 96 | 97 | This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). 99 | 100 | 101 | SEE ALSO 102 | webpmux(1), gif2webp(1) 103 | Please refer to http://developers.google.com/speed/webp/ for additional 104 | information. 105 | 106 | 107 | 108 | April 3, 2018 IMG2WEBP(1) 109 | -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/vwebp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | VWEBP 16 | 17 | 18 | 19 | 20 |

VWEBP

21 | 22 | NAME
23 | SYNOPSIS
24 | DESCRIPTION
25 | OPTIONS
26 | KEYBOARD SHORTCUTS
27 | BUGS
28 | EXAMPLES
29 | AUTHORS
30 | SEE ALSO
31 | 32 |
33 | 34 | 35 | 36 |

NAME

37 | 38 | 39 |

vwebp − 40 | decompress a WebP file and display it in a window

41 | 42 | 43 |

SYNOPSIS

44 | 45 | 46 |

vwebp 47 | [options] input_file.webp

48 | 49 | 50 |

DESCRIPTION

51 | 52 | 53 |

This manual 54 | page documents the vwebp command.

55 | 56 |

vwebp 57 | decompresses a WebP file and displays it in a window using 58 | OpenGL.

59 | 60 | 61 |

OPTIONS

62 | 63 | 64 | 66 | 67 | 68 | 73 | 74 | 79 | 81 |
69 | 70 | 71 | 72 |

−h

75 | 76 | 77 |

Print usage 78 | summary.

80 |
82 | 83 |

−version

84 | 85 |

Print version number and 86 | exit.

87 | 88 | 90 | 91 | 92 | 97 | 98 | 103 | 105 |
93 | 94 | 95 | 96 |

−noicc

99 | 100 | 101 |

Don’t use the 102 | ICC profile if present.

104 |
106 | 107 |

−nofancy

108 | 109 |

Don’t use the fancy 110 | YUV420 upscaler.

111 | 112 |

−nofilter

113 | 114 |

Disable in-loop filtering.

115 | 116 |

−dither 117 | strength

118 | 119 |

Specify a dithering 120 | strength between 0 and 100. Dithering is a 121 | post-processing effect applied to chroma components in lossy 122 | compression. It helps by smoothing gradients and avoiding 123 | banding artifacts. Default: 50.

124 | 125 | 126 |

−noalphadither

127 | 128 |

By default, quantized 129 | transparency planes are dithered during decompression, to 130 | smooth the gradients. This flag will prevent this 131 | dithering.

132 | 133 |

−usebgcolor

134 | 135 |

Fill transparent areas with the 136 | bitstream’s own background color instead of 137 | checkerboard only. Default is white for non-animated 138 | images.

139 | 140 | 142 | 143 | 144 | 149 | 150 | 155 | 156 | 157 | 162 | 163 | 168 |
145 | 146 | 147 | 148 |

−mt

151 | 152 | 153 |

Use multi-threading 154 | for decoding, if possible.

158 | 159 | 160 | 161 |

−info

164 | 165 | 166 |

Display image 167 | information on top of the decoded image.

169 | 170 |

−− 171 | string

172 | 173 |

Explicitly specify the input 174 | file. This option is useful if the input file starts with an 175 | ’−’ for instance. This option must appear 176 | last. Any other options afterward will be ignored. If 177 | the input file is "−", the data will be read 178 | from stdin instead of a file.

179 | 180 | 181 |

KEYBOARD SHORTCUTS

182 | 183 | 184 | 186 | 187 | 188 | 193 | 194 | 199 | 200 | 201 | 206 | 207 | 212 | 213 | 214 | 219 | 220 | 225 | 226 | 227 | 232 | 233 | 238 |
189 | 190 | 191 | 192 |

’c’

195 | 196 | 197 |

Toggle use of color 198 | profile.

202 | 203 | 204 | 205 |

’b’

208 | 209 | 210 |

Toggle display of 211 | background color.

215 | 216 | 217 | 218 |

’i’

221 | 222 | 223 |

Overlay file 224 | information.

228 | 229 | 230 | 231 |

’d’

234 | 235 | 236 |

Disable blending 237 | and disposal process, for debugging purposes.

239 | 240 |

’q’ / 241 | ’Q’ / ESC

242 | 243 |

Quit.

244 | 245 | 246 |

BUGS

247 | 248 | 249 |

Please report 250 | all bugs to the issue tracker: 251 | https://bugs.chromium.org/p/webp
252 | Patches welcome! See this page to get started: 253 | http://www.webmproject.org/code/contribute/submitting-patches/

254 | 255 | 256 |

EXAMPLES

257 | 258 | 259 |

vwebp 260 | picture.webp
261 | vwebp picture.webp -mt -dither 0
262 | vwebp −− −−−picture.webp

263 | 264 | 265 |

AUTHORS

266 | 267 | 268 |

vwebp is 269 | a part of libwebp and was written by the WebP team.
270 | The latest source tree is available at 271 | https://chromium.googlesource.com/webm/libwebp

272 | 273 |

This manual 274 | page was written for the Debian project (and may be used by 275 | others).

276 | 277 | 278 |

SEE ALSO

279 | 280 | 281 | 282 |

dwebp(1) 283 |
284 | Please refer to http://developers.google.com/speed/webp/ for 285 | additional information.

286 |
287 | 288 | 289 | -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/vwebp.txt: -------------------------------------------------------------------------------- 1 | VWEBP(1) VWEBP(1) 2 | 3 | 4 | 5 | NAME 6 | vwebp - decompress a WebP file and display it in a window 7 | 8 | SYNOPSIS 9 | vwebp [options] input_file.webp 10 | 11 | DESCRIPTION 12 | This manual page documents the vwebp command. 13 | 14 | vwebp decompresses a WebP file and displays it in a window using 15 | OpenGL. 16 | 17 | OPTIONS 18 | -h Print usage summary. 19 | 20 | -version 21 | Print version number and exit. 22 | 23 | -noicc Don't use the ICC profile if present. 24 | 25 | -nofancy 26 | Don't use the fancy YUV420 upscaler. 27 | 28 | -nofilter 29 | Disable in-loop filtering. 30 | 31 | -dither strength 32 | Specify a dithering strength between 0 and 100. Dithering is a 33 | post-processing effect applied to chroma components in lossy 34 | compression. It helps by smoothing gradients and avoiding band- 35 | ing artifacts. Default: 50. 36 | 37 | -noalphadither 38 | By default, quantized transparency planes are dithered during 39 | decompression, to smooth the gradients. This flag will prevent 40 | this dithering. 41 | 42 | -usebgcolor 43 | Fill transparent areas with the bitstream's own background color 44 | instead of checkerboard only. Default is white for non-animated 45 | images. 46 | 47 | -mt Use multi-threading for decoding, if possible. 48 | 49 | -info Display image information on top of the decoded image. 50 | 51 | -- string 52 | Explicitly specify the input file. This option is useful if the 53 | input file starts with an '-' for instance. This option must 54 | appear last. Any other options afterward will be ignored. If 55 | the input file is "-", the data will be read from stdin instead 56 | of a file. 57 | 58 | 59 | 60 | KEYBOARD SHORTCUTS 61 | 62 | 'c' Toggle use of color profile. 63 | 64 | 'b' Toggle display of background color. 65 | 66 | 'i' Overlay file information. 67 | 68 | 'd' Disable blending and disposal process, for debugging purposes. 69 | 70 | 'q' / 'Q' / ESC 71 | Quit. 72 | 73 | 74 | BUGS 75 | Please report all bugs to the issue tracker: 76 | https://bugs.chromium.org/p/webp 77 | Patches welcome! See this page to get started: http://www.webmpro- 78 | ject.org/code/contribute/submitting-patches/ 79 | 80 | 81 | EXAMPLES 82 | vwebp picture.webp 83 | vwebp picture.webp -mt -dither 0 84 | vwebp -- ---picture.webp 85 | 86 | 87 | AUTHORS 88 | vwebp is a part of libwebp and was written by the WebP team. 89 | The latest source tree is available at https://chromium.google- 90 | source.com/webm/libwebp 91 | 92 | This manual page was written for the Debian project (and may be used by 93 | others). 94 | 95 | 96 | SEE ALSO 97 | dwebp(1) 98 | Please refer to http://developers.google.com/speed/webp/ for additional 99 | information. 100 | 101 | 102 | 103 | June 5, 2019 VWEBP(1) 104 | -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/webpinfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | WEBPINFO 16 | 17 | 18 | 19 | 20 |

WEBPINFO

21 | 22 | NAME
23 | SYNOPSIS
24 | DESCRIPTION
25 | OPTIONS
26 | INPUT
27 | BUGS
28 | EXAMPLES
29 | AUTHORS
30 | SEE ALSO
31 | 32 |
33 | 34 | 35 | 36 |

NAME

37 | 38 | 39 |

webpinfo 40 | − print out the chunk level structure of WebP files 41 | along with basic integrity checks.

42 | 43 | 44 |

SYNOPSIS

45 | 46 | 47 | 48 |

webpinfo 49 | OPTIONS INPUT
50 | webpinfo 51 | [−h|−help|−H|−longhelp]

52 | 53 | 54 |

DESCRIPTION

55 | 56 | 57 |

This manual 58 | page documents the webpinfo command.

59 | 60 | 61 |

webpinfo 62 | can be used to print out the chunk level structure and 63 | bitstream header information of WebP files. It can also 64 | check if the files are of valid WebP format.

65 | 66 | 67 |

OPTIONS

68 | 69 | 70 | 71 |

−version

72 | 73 |

Print the version number (as 74 | major.minor.revision) and exit.

75 | 76 | 78 | 79 | 80 | 85 | 86 | 91 | 93 | 94 | 95 | 100 | 101 | 106 | 108 |
81 | 82 | 83 | 84 |

−quiet

87 | 88 | 89 |

Do not show chunk 90 | parsing information.

92 |
96 | 97 | 98 | 99 |

−diag

102 | 103 | 104 |

Show parsing error 105 | diagnosis.

107 |
109 | 110 |

−summary

111 | 112 |

Show chunk stats summary.

113 | 114 | 115 |

−bitstream_info

116 | 117 |

Parse bitstream header.

118 | 119 |

−h, 120 | −help

121 | 122 |

A short usage summary.

123 | 124 |

−H, 125 | −longhelp

126 | 127 |

Detailed usage 128 | instructions.

129 | 130 | 131 |

INPUT

132 | 133 | 134 |

Input files in 135 | WebP format. Input files must come last, following options 136 | (if any). There can be multiple input files.

137 | 138 | 139 |

BUGS

140 | 141 | 142 |

Please report 143 | all bugs to the issue tracker: 144 | https://bugs.chromium.org/p/webp
145 | Patches welcome! See this page to get started: 146 | http://www.webmproject.org/code/contribute/submitting−patches/

147 | 148 | 149 |

EXAMPLES

150 | 151 | 152 |

webpinfo 153 | −h
154 | webpinfo −diag −summary input_file.webp
155 | webpinfo −bitstream_info input_file_1.webp 156 | input_file_2.webp
157 | webpinfo *.webp

158 | 159 | 160 |

AUTHORS

161 | 162 | 163 | 164 |

webpinfo 165 | is a part of libwebp and was written by the WebP team.
166 | The latest source tree is available at 167 | https://chromium.googlesource.com/webm/libwebp

168 | 169 |

This manual 170 | page was written by Hui Su <huisu@google.com>, for the 171 | Debian project (and may be used by others).

172 | 173 | 174 |

SEE ALSO

175 | 176 | 177 | 178 |

webpmux(1) 179 |
180 | Please refer to http://developers.google.com/speed/webp/ for 181 | additional information.

182 |
183 | 184 | 185 | -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/webpinfo.txt: -------------------------------------------------------------------------------- 1 | WEBPINFO(1) WEBPINFO(1) 2 | 3 | 4 | 5 | NAME 6 | webpinfo - print out the chunk level structure of WebP files along with 7 | basic integrity checks. 8 | 9 | SYNOPSIS 10 | webpinfo OPTIONS INPUT 11 | webpinfo [-h|-help|-H|-longhelp] 12 | 13 | 14 | DESCRIPTION 15 | This manual page documents the webpinfo command. 16 | 17 | webpinfo can be used to print out the chunk level structure and bit- 18 | stream header information of WebP files. It can also check if the files 19 | are of valid WebP format. 20 | 21 | 22 | OPTIONS 23 | -version 24 | Print the version number (as major.minor.revision) and exit. 25 | 26 | -quiet Do not show chunk parsing information. 27 | 28 | -diag Show parsing error diagnosis. 29 | 30 | -summary 31 | Show chunk stats summary. 32 | 33 | -bitstream_info 34 | Parse bitstream header. 35 | 36 | -h, -help 37 | A short usage summary. 38 | 39 | -H, -longhelp 40 | Detailed usage instructions. 41 | 42 | 43 | INPUT 44 | Input files in WebP format. Input files must come last, following 45 | options (if any). There can be multiple input files. 46 | 47 | 48 | BUGS 49 | Please report all bugs to the issue tracker: 50 | https://bugs.chromium.org/p/webp 51 | Patches welcome! See this page to get started: http://www.webmpro- 52 | ject.org/code/contribute/submitting-patches/ 53 | 54 | 55 | EXAMPLES 56 | webpinfo -h 57 | webpinfo -diag -summary input_file.webp 58 | webpinfo -bitstream_info input_file_1.webp input_file_2.webp 59 | webpinfo *.webp 60 | 61 | 62 | AUTHORS 63 | webpinfo is a part of libwebp and was written by the WebP team. 64 | The latest source tree is available at https://chromium.google- 65 | source.com/webm/libwebp 66 | 67 | This manual page was written by Hui Su , for the 68 | Debian project (and may be used by others). 69 | 70 | 71 | SEE ALSO 72 | webpmux(1) 73 | Please refer to http://developers.google.com/speed/webp/ for additional 74 | information. 75 | 76 | 77 | 78 | November 24, 2017 WEBPINFO(1) 79 | -------------------------------------------------------------------------------- /lib/libwebp_osx/doc/webpmux.txt: -------------------------------------------------------------------------------- 1 | WEBPMUX(1) WEBPMUX(1) 2 | 3 | 4 | 5 | NAME 6 | webpmux - create animated WebP files from non-animated WebP images, 7 | extract frames from animated WebP images, and manage XMP/EXIF metadata 8 | and ICC profile. 9 | 10 | SYNOPSIS 11 | webpmux -get GET_OPTIONS INPUT -o OUTPUT 12 | webpmux -set SET_OPTIONS INPUT -o OUTPUT 13 | webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT 14 | webpmux -frame FRAME_OPTIONS [ -frame ... ] [ -loop LOOP_COUNT ] 15 | [ -bgcolor BACKGROUND_COLOR ] -o OUTPUT 16 | webpmux -duration DURATION OPTIONS [ -duration ... ] INPUT -o OUTPUT 17 | webpmux -info INPUT 18 | webpmux [-h|-help] 19 | webpmux -version 20 | webpmux argument_file_name 21 | 22 | DESCRIPTION 23 | This manual page documents the webpmux command. 24 | 25 | webpmux can be used to create/extract from animated WebP files, as well 26 | as to add/extract/strip XMP/EXIF metadata and ICC profile. If a single 27 | file name (not starting with the character '-') is supplied as the 28 | argument, the command line arguments are actually tokenized from this 29 | file. This allows for easy scripting or using large number of argu- 30 | ments. 31 | 32 | OPTIONS 33 | GET_OPTIONS (-get): 34 | icc Get ICC profile. 35 | 36 | exif Get EXIF metadata. 37 | 38 | xmp Get XMP metadata. 39 | 40 | frame n 41 | Get nth frame from an animated image. (n = 0 has a special mean- 42 | ing: last frame). 43 | 44 | 45 | SET_OPTIONS (-set) 46 | icc file.icc 47 | Set ICC profile. 48 | 49 | Where: 'file.icc' contains the ICC profile to be set. 50 | 51 | exif file.exif 52 | Set EXIF metadata. 53 | 54 | Where: 'file.exif' contains the EXIF metadata to be set. 55 | 56 | xmp file.xmp 57 | Set XMP metadata. 58 | 59 | Where: 'file.xmp' contains the XMP metadata to be set. 60 | 61 | 62 | STRIP_OPTIONS (-strip) 63 | icc Strip ICC profile. 64 | 65 | exif Strip EXIF metadata. 66 | 67 | xmp Strip XMP metadata. 68 | 69 | 70 | DURATION_OPTIONS (-duration) 71 | Amend the duration of a specific interval of frames. This option is 72 | only effective on animated WebP and has no effect on a single-frame 73 | file. 74 | 75 | duration[,start[,end]] 76 | Where: 77 | duration is the duration for the interval in milliseconds 78 | (mandatory). Must be non-negative. 79 | start is the starting frame index of the interval (optional). 80 | end is the ending frame index (inclusive) of the interval 81 | (optional). 82 | 83 | The three typical usages of this option are: 84 | -duration d 85 | set the duration to 'd' for the whole animation. 86 | -duration d,f 87 | set the duration of frame 'f' to 'd'. 88 | -duration d,start,end 89 | set the duration to 'd' for the whole [start,end] interval. 90 | 91 | 92 | Note that the frames outside of the [start, end] interval will 93 | remain untouched. 94 | The 'end' value '0' has the special meaning 'last frame of the 95 | animation'. 96 | 97 | Reminder: 98 | frame indexing starts at '1'. 99 | 100 | 101 | FRAME_OPTIONS (-frame) 102 | Create an animated WebP file from multiple (non-animated) WebP images. 103 | 104 | file_i +di[+xi+yi[+mi[bi]]] 105 | Where: 'file_i' is the i'th frame (WebP format), 'xi','yi' spec- 106 | ify the image offset for this frame, 'di' is the pause duration 107 | before next frame, 'mi' is the dispose method for this frame (0 108 | for NONE or 1 for BACKGROUND) and 'bi' is the blending method 109 | for this frame (+b for BLEND or -b for NO_BLEND). Argument 'bi' 110 | can be omitted and will default to +b (BLEND). Also, 'mi' can 111 | be omitted if 'bi' is omitted and will default to 0 (NONE). 112 | Finally, if 'mi' and 'bi' are omitted then 'xi' and 'yi' can be 113 | omitted and will default to +0+0. 114 | 115 | -loop n 116 | Loop the frames n number of times. 0 indicates the frames should 117 | loop forever. Valid range is 0 to 65535 [Default: 0 (infi- 118 | nite)]. 119 | 120 | -bgcolor A,R,G,B 121 | Background color of the canvas. 122 | where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 123 | specifying the Alpha, Red, Green and Blue component values 124 | respectively [Default: 255,255,255,255]. 125 | 126 | 127 | INPUT 128 | Input file in WebP format. 129 | 130 | 131 | OUTPUT (-o) 132 | Output file in WebP format. 133 | 134 | 135 | Note: 136 | The nature of EXIF, XMP and ICC data is not checked and is assumed to 137 | be valid. 138 | 139 | 140 | BUGS 141 | Please report all bugs to the issue tracker: 142 | https://bugs.chromium.org/p/webp 143 | Patches welcome! See this page to get started: http://www.webmpro- 144 | ject.org/code/contribute/submitting-patches/ 145 | 146 | 147 | EXAMPLES 148 | Add ICC profile: 149 | webpmux -set icc image_profile.icc in.webp -o icc_container.webp 150 | 151 | Extract ICC profile: 152 | webpmux -get icc icc_container.webp -o image_profile.icc 153 | 154 | Strip ICC profile: 155 | webpmux -strip icc icc_container.webp -o without_icc.webp 156 | 157 | Add XMP metadata: 158 | webpmux -set xmp image_metadata.xmp in.webp -o xmp_container.webp 159 | 160 | Extract XMP metadata: 161 | webpmux -get xmp xmp_container.webp -o image_metadata.xmp 162 | 163 | Strip XMP metadata: 164 | webpmux -strip xmp xmp_container.webp -o without_xmp.webp 165 | 166 | Add EXIF metadata: 167 | webpmux -set exif image_metadata.exif in.webp -o exif_container.webp 168 | 169 | Extract EXIF metadata: 170 | webpmux -get exif exif_container.webp -o image_metadata.exif 171 | 172 | Strip EXIF metadata: 173 | webpmux -strip exif exif_container.webp -o without_exif.webp 174 | 175 | Create an animated WebP file from 3 (non-animated) WebP images: 176 | webpmux -frame 1.webp +100 -frame 2.webp +100+50+50 177 | -frame 3.webp +100+50+50+1+b -loop 10 -bgcolor 255,255,255,255 178 | -o anim_container.webp 179 | 180 | Get the 2nd frame from an animated WebP file: 181 | webpmux -get frame 2 anim_container.webp -o frame_2.webp 182 | 183 | Using -get/-set/-strip with input file name starting with '-': 184 | webpmux -set icc image_profile.icc -o icc_container.webp -- ---in.webp 185 | webpmux -get icc -o image_profile.icc -- ---icc_container.webp 186 | webpmux -strip icc -o without_icc.webp -- ---icc_container.webp 187 | 188 | 189 | AUTHORS 190 | webpmux is a part of libwebp and was written by the WebP team. 191 | The latest source tree is available at https://chromium.google- 192 | source.com/webm/libwebp 193 | 194 | This manual page was written by Vikas Arora , 195 | for the Debian project (and may be used by others). 196 | 197 | 198 | SEE ALSO 199 | cwebp(1), dwebp(1), gif2webp(1) 200 | Please refer to http://developers.google.com/speed/webp/ for additional 201 | information. 202 | 203 | 204 | 205 | April 23, 2018 WEBPMUX(1) 206 | -------------------------------------------------------------------------------- /lib/libwebp_osx/include/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/include/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_osx/include/webp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/include/webp/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_osx/include/webp/mux_types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the COPYING file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | // ----------------------------------------------------------------------------- 9 | // 10 | // Data-types common to the mux and demux libraries. 11 | // 12 | // Author: Urvang (urvang@google.com) 13 | 14 | #ifndef WEBP_WEBP_MUX_TYPES_H_ 15 | #define WEBP_WEBP_MUX_TYPES_H_ 16 | 17 | #include // memset() 18 | #include "./types.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | // Note: forward declaring enumerations is not allowed in (strict) C and C++, 25 | // the types are left here for reference. 26 | // typedef enum WebPFeatureFlags WebPFeatureFlags; 27 | // typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; 28 | // typedef enum WebPMuxAnimBlend WebPMuxAnimBlend; 29 | typedef struct WebPData WebPData; 30 | 31 | // VP8X Feature Flags. 32 | typedef enum WebPFeatureFlags { 33 | ANIMATION_FLAG = 0x00000002, 34 | XMP_FLAG = 0x00000004, 35 | EXIF_FLAG = 0x00000008, 36 | ALPHA_FLAG = 0x00000010, 37 | ICCP_FLAG = 0x00000020, 38 | 39 | ALL_VALID_FLAGS = 0x0000003e 40 | } WebPFeatureFlags; 41 | 42 | // Dispose method (animation only). Indicates how the area used by the current 43 | // frame is to be treated before rendering the next frame on the canvas. 44 | typedef enum WebPMuxAnimDispose { 45 | WEBP_MUX_DISPOSE_NONE, // Do not dispose. 46 | WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. 47 | } WebPMuxAnimDispose; 48 | 49 | // Blend operation (animation only). Indicates how transparent pixels of the 50 | // current frame are blended with those of the previous canvas. 51 | typedef enum WebPMuxAnimBlend { 52 | WEBP_MUX_BLEND, // Blend. 53 | WEBP_MUX_NO_BLEND // Do not blend. 54 | } WebPMuxAnimBlend; 55 | 56 | // Data type used to describe 'raw' data, e.g., chunk data 57 | // (ICC profile, metadata) and WebP compressed image data. 58 | // 'bytes' memory must be allocated using WebPMalloc() and such. 59 | struct WebPData { 60 | const uint8_t* bytes; 61 | size_t size; 62 | }; 63 | 64 | // Initializes the contents of the 'webp_data' object with default values. 65 | static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { 66 | if (webp_data != NULL) { 67 | memset(webp_data, 0, sizeof(*webp_data)); 68 | } 69 | } 70 | 71 | // Clears the contents of the 'webp_data' object by calling WebPFree(). 72 | // Does not deallocate the object itself. 73 | static WEBP_INLINE void WebPDataClear(WebPData* webp_data) { 74 | if (webp_data != NULL) { 75 | WebPFree((void*)webp_data->bytes); 76 | WebPDataInit(webp_data); 77 | } 78 | } 79 | 80 | // Allocates necessary storage for 'dst' and copies the contents of 'src'. 81 | // Returns true on success. 82 | static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) { 83 | if (src == NULL || dst == NULL) return 0; 84 | WebPDataInit(dst); 85 | if (src->bytes != NULL && src->size != 0) { 86 | dst->bytes = (uint8_t*)WebPMalloc(src->size); 87 | if (dst->bytes == NULL) return 0; 88 | memcpy((void*)dst->bytes, src->bytes, src->size); 89 | dst->size = src->size; 90 | } 91 | return 1; 92 | } 93 | 94 | #ifdef __cplusplus 95 | } // extern "C" 96 | #endif 97 | 98 | #endif // WEBP_WEBP_MUX_TYPES_H_ 99 | -------------------------------------------------------------------------------- /lib/libwebp_osx/include/webp/types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010 Google Inc. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the COPYING file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | // ----------------------------------------------------------------------------- 9 | // 10 | // Common types + memory wrappers 11 | // 12 | // Author: Skal (pascal.massimino@gmail.com) 13 | 14 | #ifndef WEBP_WEBP_TYPES_H_ 15 | #define WEBP_WEBP_TYPES_H_ 16 | 17 | #include // for size_t 18 | 19 | #ifndef _MSC_VER 20 | #include 21 | #if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ 22 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) 23 | #define WEBP_INLINE inline 24 | #else 25 | #define WEBP_INLINE 26 | #endif 27 | #else 28 | typedef signed char int8_t; 29 | typedef unsigned char uint8_t; 30 | typedef signed short int16_t; 31 | typedef unsigned short uint16_t; 32 | typedef signed int int32_t; 33 | typedef unsigned int uint32_t; 34 | typedef unsigned long long int uint64_t; 35 | typedef long long int int64_t; 36 | #define WEBP_INLINE __forceinline 37 | #endif /* _MSC_VER */ 38 | 39 | #ifndef WEBP_EXTERN 40 | // This explicitly marks library functions and allows for changing the 41 | // signature for e.g., Windows DLL builds. 42 | # if defined(__GNUC__) && __GNUC__ >= 4 43 | # define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) 44 | # else 45 | # define WEBP_EXTERN extern 46 | # endif /* __GNUC__ >= 4 */ 47 | #endif /* WEBP_EXTERN */ 48 | 49 | // Macro to check ABI compatibility (same major revision number) 50 | #define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | // Allocates 'size' bytes of memory. Returns NULL upon error. Memory 57 | // must be deallocated by calling WebPFree(). This function is made available 58 | // by the core 'libwebp' library. 59 | WEBP_EXTERN void* WebPMalloc(size_t size); 60 | 61 | // Releases memory returned by the WebPDecode*() functions (from decode.h). 62 | WEBP_EXTERN void WebPFree(void* ptr); 63 | 64 | #ifdef __cplusplus 65 | } // extern "C" 66 | #endif 67 | 68 | #endif // WEBP_WEBP_TYPES_H_ 69 | -------------------------------------------------------------------------------- /lib/libwebp_osx/lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/lib/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_osx/lib/libwebp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/lib/libwebp.a -------------------------------------------------------------------------------- /lib/libwebp_osx/lib/libwebpdemux.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/lib/libwebpdemux.a -------------------------------------------------------------------------------- /lib/libwebp_osx/lib/libwebpmux.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_osx/lib/libwebpmux.a -------------------------------------------------------------------------------- /lib/libwebp_win64/Readme-mux.txt: -------------------------------------------------------------------------------- 1 |  __ __ ____ ____ ____ __ __ _ __ __ 2 | / \\/ \/ _ \/ _ \/ _ \/ \ \/ \___/_ / _\ 3 | \ / __/ _ \ __/ / / (_/ /__ 4 | \__\__/\_____/_____/__/ \__//_/\_____/__/___/v1.1.0 5 | 6 | 7 | Description: 8 | ============ 9 | 10 | WebPMux: set of two libraries 'Mux' and 'Demux' for creation, extraction and 11 | manipulation of an extended format WebP file, which can have features like 12 | color profile, metadata and animation. Reference command-line tools 'webpmux' 13 | and 'vwebp' as well as the WebP container specification 14 | 'doc/webp-container-spec.txt' are also provided in this package. 15 | 16 | WebP Mux tool: 17 | ============== 18 | 19 | The examples/ directory contains a tool (webpmux) for manipulating WebP 20 | files. The webpmux tool can be used to create an extended format WebP file and 21 | also to extract or strip relevant data from such a file. 22 | 23 | A list of options is available using the -help command line flag: 24 | 25 | > webpmux -help 26 | Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT 27 | webpmux -set SET_OPTIONS INPUT -o OUTPUT 28 | webpmux -duration DURATION_OPTIONS [-duration ...] 29 | INPUT -o OUTPUT 30 | webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT 31 | webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT] 32 | [-bgcolor BACKGROUND_COLOR] -o OUTPUT 33 | webpmux -info INPUT 34 | webpmux [-h|-help] 35 | webpmux -version 36 | webpmux argument_file_name 37 | 38 | GET_OPTIONS: 39 | Extract relevant data: 40 | icc get ICC profile 41 | exif get EXIF metadata 42 | xmp get XMP metadata 43 | frame n get nth frame 44 | 45 | SET_OPTIONS: 46 | Set color profile/metadata: 47 | icc file.icc set ICC profile 48 | exif file.exif set EXIF metadata 49 | xmp file.xmp set XMP metadata 50 | where: 'file.icc' contains the ICC profile to be set, 51 | 'file.exif' contains the EXIF metadata to be set 52 | 'file.xmp' contains the XMP metadata to be set 53 | 54 | DURATION_OPTIONS: 55 | Set duration of selected frames: 56 | duration set duration for each frames 57 | duration,frame set duration of a particular frame 58 | duration,start,end set duration of frames in the 59 | interval [start,end]) 60 | where: 'duration' is the duration in milliseconds 61 | 'start' is the start frame index 62 | 'end' is the inclusive end frame index 63 | The special 'end' value '0' means: last frame. 64 | 65 | STRIP_OPTIONS: 66 | Strip color profile/metadata: 67 | icc strip ICC profile 68 | exif strip EXIF metadata 69 | xmp strip XMP metadata 70 | 71 | FRAME_OPTIONS(i): 72 | Create animation: 73 | file_i +di+[xi+yi[+mi[bi]]] 74 | where: 'file_i' is the i'th animation frame (WebP format), 75 | 'di' is the pause duration before next frame, 76 | 'xi','yi' specify the image offset for this frame, 77 | 'mi' is the dispose method for this frame (0 or 1), 78 | 'bi' is the blending method for this frame (+b or -b) 79 | 80 | LOOP_COUNT: 81 | Number of times to repeat the animation. 82 | Valid range is 0 to 65535 [Default: 0 (infinite)]. 83 | 84 | BACKGROUND_COLOR: 85 | Background color of the canvas. 86 | A,R,G,B 87 | where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying 88 | the Alpha, Red, Green and Blue component values respectively 89 | [Default: 255,255,255,255] 90 | 91 | INPUT & OUTPUT are in WebP format. 92 | 93 | Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be 94 | valid. 95 | 96 | Note: if a single file name is passed as the argument, the arguments will be 97 | tokenized from this file. The file name must not start with the character '-'. 98 | 99 | Visualization tool: 100 | =================== 101 | 102 | The examples/ directory also contains a tool (vwebp) for viewing WebP files. 103 | It decodes the image and visualizes it using OpenGL. See the libwebp README 104 | for details on building and running this program. 105 | 106 | Mux API: 107 | ======== 108 | The Mux API contains methods for adding data to and reading data from WebP 109 | files. This API currently supports XMP/EXIF metadata, ICC profile and animation. 110 | Other features may be added in subsequent releases. 111 | 112 | Example#1 (pseudo code): Creating a WebPMux object with image data, color 113 | profile and XMP metadata. 114 | 115 | int copy_data = 0; 116 | WebPMux* mux = WebPMuxNew(); 117 | // ... (Prepare image data). 118 | WebPMuxSetImage(mux, &image, copy_data); 119 | // ... (Prepare ICC profile data). 120 | WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); 121 | // ... (Prepare XMP metadata). 122 | WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); 123 | // Get data from mux in WebP RIFF format. 124 | WebPMuxAssemble(mux, &output_data); 125 | WebPMuxDelete(mux); 126 | // ... (Consume output_data; e.g. write output_data.bytes to file). 127 | WebPDataClear(&output_data); 128 | 129 | 130 | Example#2 (pseudo code): Get image and color profile data from a WebP file. 131 | 132 | int copy_data = 0; 133 | // ... (Read data from file). 134 | WebPMux* mux = WebPMuxCreate(&data, copy_data); 135 | WebPMuxGetFrame(mux, 1, &image); 136 | // ... (Consume image; e.g. call WebPDecode() to decode the data). 137 | WebPMuxGetChunk(mux, "ICCP", &icc_profile); 138 | // ... (Consume icc_profile). 139 | WebPMuxDelete(mux); 140 | free(data); 141 | 142 | 143 | For a detailed Mux API reference, please refer to the header file 144 | (src/webp/mux.h). 145 | 146 | Demux API: 147 | ========== 148 | The Demux API enables extraction of images and extended format data from 149 | WebP files. This API currently supports reading of XMP/EXIF metadata, ICC 150 | profile and animated images. Other features may be added in subsequent 151 | releases. 152 | 153 | Code example: Demuxing WebP data to extract all the frames, ICC profile 154 | and EXIF/XMP metadata. 155 | 156 | WebPDemuxer* demux = WebPDemux(&webp_data); 157 | uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); 158 | uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); 159 | // ... (Get information about the features present in the WebP file). 160 | uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); 161 | 162 | // ... (Iterate over all frames). 163 | WebPIterator iter; 164 | if (WebPDemuxGetFrame(demux, 1, &iter)) { 165 | do { 166 | // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), 167 | // ... and get other frame properties like width, height, offsets etc. 168 | // ... see 'struct WebPIterator' below for more info). 169 | } while (WebPDemuxNextFrame(&iter)); 170 | WebPDemuxReleaseIterator(&iter); 171 | } 172 | 173 | // ... (Extract metadata). 174 | WebPChunkIterator chunk_iter; 175 | if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); 176 | // ... (Consume the ICC profile in 'chunk_iter.chunk'). 177 | WebPDemuxReleaseChunkIterator(&chunk_iter); 178 | if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); 179 | // ... (Consume the EXIF metadata in 'chunk_iter.chunk'). 180 | WebPDemuxReleaseChunkIterator(&chunk_iter); 181 | if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); 182 | // ... (Consume the XMP metadata in 'chunk_iter.chunk'). 183 | WebPDemuxReleaseChunkIterator(&chunk_iter); 184 | WebPDemuxDelete(demux); 185 | 186 | 187 | For a detailed Demux API reference, please refer to the header file 188 | (src/webp/demux.h). 189 | 190 | AnimEncoder API: 191 | ================ 192 | The AnimEncoder API can be used to create animated WebP images. 193 | 194 | Code example: 195 | 196 | WebPAnimEncoderOptions enc_options; 197 | WebPAnimEncoderOptionsInit(&enc_options); 198 | // ... (Tune 'enc_options' as needed). 199 | WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); 200 | while() { 201 | WebPConfig config; 202 | WebPConfigInit(&config); 203 | // ... (Tune 'config' as needed). 204 | WebPAnimEncoderAdd(enc, frame, duration, &config); 205 | } 206 | WebPAnimEncoderAssemble(enc, webp_data); 207 | WebPAnimEncoderDelete(enc); 208 | // ... (Write the 'webp_data' to a file, or re-mux it further). 209 | 210 | 211 | For a detailed AnimEncoder API reference, please refer to the header file 212 | (src/webp/mux.h). 213 | 214 | AnimDecoder API: 215 | ================ 216 | This AnimDecoder API allows decoding (possibly) animated WebP images. 217 | 218 | Code Example: 219 | 220 | WebPAnimDecoderOptions dec_options; 221 | WebPAnimDecoderOptionsInit(&dec_options); 222 | // Tune 'dec_options' as needed. 223 | WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); 224 | WebPAnimInfo anim_info; 225 | WebPAnimDecoderGetInfo(dec, &anim_info); 226 | for (uint32_t i = 0; i < anim_info.loop_count; ++i) { 227 | while (WebPAnimDecoderHasMoreFrames(dec)) { 228 | uint8_t* buf; 229 | int timestamp; 230 | WebPAnimDecoderGetNext(dec, &buf, ×tamp); 231 | // ... (Render 'buf' based on 'timestamp'). 232 | // ... (Do NOT free 'buf', as it is owned by 'dec'). 233 | } 234 | WebPAnimDecoderReset(dec); 235 | } 236 | const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); 237 | // ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). 238 | WebPAnimDecoderDelete(dec); 239 | 240 | For a detailed AnimDecoder API reference, please refer to the header file 241 | (src/webp/demux.h). 242 | 243 | 244 | Bugs: 245 | ===== 246 | 247 | Please report all bugs to the issue tracker: 248 | https://bugs.chromium.org/p/webp 249 | Patches welcome! See this page to get started: 250 | http://www.webmproject.org/code/contribute/submitting-patches/ 251 | 252 | Discuss: 253 | ======== 254 | 255 | Email: webp-discuss@webmproject.org 256 | Web: http://groups.google.com/a/webmproject.org/group/webp-discuss 257 | -------------------------------------------------------------------------------- /lib/libwebp_win64/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/anim_diff.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/anim_diff.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/anim_dump.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/anim_dump.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/cwebp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/cwebp.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/dwebp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/dwebp.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/freeglut.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/freeglut.dll -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/get_disto.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/get_disto.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/gif2webp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/gif2webp.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/img2webp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/img2webp.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/vwebp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/vwebp.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/webp_quality.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/webp_quality.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/webpinfo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/webpinfo.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/bin/webpmux.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/bin/webpmux.exe -------------------------------------------------------------------------------- /lib/libwebp_win64/include/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/include/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_win64/include/webp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/include/webp/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_win64/include/webp/mux_types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the COPYING file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | // ----------------------------------------------------------------------------- 9 | // 10 | // Data-types common to the mux and demux libraries. 11 | // 12 | // Author: Urvang (urvang@google.com) 13 | 14 | #ifndef WEBP_WEBP_MUX_TYPES_H_ 15 | #define WEBP_WEBP_MUX_TYPES_H_ 16 | 17 | #include // memset() 18 | #include "./types.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | // Note: forward declaring enumerations is not allowed in (strict) C and C++, 25 | // the types are left here for reference. 26 | // typedef enum WebPFeatureFlags WebPFeatureFlags; 27 | // typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; 28 | // typedef enum WebPMuxAnimBlend WebPMuxAnimBlend; 29 | typedef struct WebPData WebPData; 30 | 31 | // VP8X Feature Flags. 32 | typedef enum WebPFeatureFlags { 33 | ANIMATION_FLAG = 0x00000002, 34 | XMP_FLAG = 0x00000004, 35 | EXIF_FLAG = 0x00000008, 36 | ALPHA_FLAG = 0x00000010, 37 | ICCP_FLAG = 0x00000020, 38 | 39 | ALL_VALID_FLAGS = 0x0000003e 40 | } WebPFeatureFlags; 41 | 42 | // Dispose method (animation only). Indicates how the area used by the current 43 | // frame is to be treated before rendering the next frame on the canvas. 44 | typedef enum WebPMuxAnimDispose { 45 | WEBP_MUX_DISPOSE_NONE, // Do not dispose. 46 | WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. 47 | } WebPMuxAnimDispose; 48 | 49 | // Blend operation (animation only). Indicates how transparent pixels of the 50 | // current frame are blended with those of the previous canvas. 51 | typedef enum WebPMuxAnimBlend { 52 | WEBP_MUX_BLEND, // Blend. 53 | WEBP_MUX_NO_BLEND // Do not blend. 54 | } WebPMuxAnimBlend; 55 | 56 | // Data type used to describe 'raw' data, e.g., chunk data 57 | // (ICC profile, metadata) and WebP compressed image data. 58 | // 'bytes' memory must be allocated using WebPMalloc() and such. 59 | struct WebPData { 60 | const uint8_t* bytes; 61 | size_t size; 62 | }; 63 | 64 | // Initializes the contents of the 'webp_data' object with default values. 65 | static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { 66 | if (webp_data != NULL) { 67 | memset(webp_data, 0, sizeof(*webp_data)); 68 | } 69 | } 70 | 71 | // Clears the contents of the 'webp_data' object by calling WebPFree(). 72 | // Does not deallocate the object itself. 73 | static WEBP_INLINE void WebPDataClear(WebPData* webp_data) { 74 | if (webp_data != NULL) { 75 | WebPFree((void*)webp_data->bytes); 76 | WebPDataInit(webp_data); 77 | } 78 | } 79 | 80 | // Allocates necessary storage for 'dst' and copies the contents of 'src'. 81 | // Returns true on success. 82 | static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) { 83 | if (src == NULL || dst == NULL) return 0; 84 | WebPDataInit(dst); 85 | if (src->bytes != NULL && src->size != 0) { 86 | dst->bytes = (uint8_t*)WebPMalloc(src->size); 87 | if (dst->bytes == NULL) return 0; 88 | memcpy((void*)dst->bytes, src->bytes, src->size); 89 | dst->size = src->size; 90 | } 91 | return 1; 92 | } 93 | 94 | #ifdef __cplusplus 95 | } // extern "C" 96 | #endif 97 | 98 | #endif // WEBP_WEBP_MUX_TYPES_H_ 99 | -------------------------------------------------------------------------------- /lib/libwebp_win64/include/webp/types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010 Google Inc. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the COPYING file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | // ----------------------------------------------------------------------------- 9 | // 10 | // Common types + memory wrappers 11 | // 12 | // Author: Skal (pascal.massimino@gmail.com) 13 | 14 | #ifndef WEBP_WEBP_TYPES_H_ 15 | #define WEBP_WEBP_TYPES_H_ 16 | 17 | #include // for size_t 18 | 19 | #ifndef _MSC_VER 20 | #include 21 | #if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ 22 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) 23 | #define WEBP_INLINE inline 24 | #else 25 | #define WEBP_INLINE 26 | #endif 27 | #else 28 | typedef signed char int8_t; 29 | typedef unsigned char uint8_t; 30 | typedef signed short int16_t; 31 | typedef unsigned short uint16_t; 32 | typedef signed int int32_t; 33 | typedef unsigned int uint32_t; 34 | typedef unsigned long long int uint64_t; 35 | typedef long long int int64_t; 36 | #define WEBP_INLINE __forceinline 37 | #endif /* _MSC_VER */ 38 | 39 | #ifndef WEBP_EXTERN 40 | // This explicitly marks library functions and allows for changing the 41 | // signature for e.g., Windows DLL builds. 42 | # if defined(__GNUC__) && __GNUC__ >= 4 43 | # define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) 44 | # else 45 | # define WEBP_EXTERN extern 46 | # endif /* __GNUC__ >= 4 */ 47 | #endif /* WEBP_EXTERN */ 48 | 49 | // Macro to check ABI compatibility (same major revision number) 50 | #define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | // Allocates 'size' bytes of memory. Returns NULL upon error. Memory 57 | // must be deallocated by calling WebPFree(). This function is made available 58 | // by the core 'libwebp' library. 59 | WEBP_EXTERN void* WebPMalloc(size_t size); 60 | 61 | // Releases memory returned by the WebPDecode*() functions (from decode.h). 62 | WEBP_EXTERN void WebPFree(void* ptr); 63 | 64 | #ifdef __cplusplus 65 | } // extern "C" 66 | #endif 67 | 68 | #endif // WEBP_WEBP_TYPES_H_ 69 | -------------------------------------------------------------------------------- /lib/libwebp_win64/lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/lib/__init__.py -------------------------------------------------------------------------------- /lib/libwebp_win64/lib/libwebp.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/lib/libwebp.lib -------------------------------------------------------------------------------- /lib/libwebp_win64/lib/libwebpdemux.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/lib/libwebpdemux.lib -------------------------------------------------------------------------------- /lib/libwebp_win64/lib/libwebpmux.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/lib/libwebpmux.lib -------------------------------------------------------------------------------- /lib/libwebp_win64/test.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/test.webp -------------------------------------------------------------------------------- /lib/libwebp_win64/test_ref.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/lib/libwebp_win64/test_ref.ppm -------------------------------------------------------------------------------- /lib/version_info.txt: -------------------------------------------------------------------------------- 1 | libwebp v1.1.0 2 | 3 | https://developers.google.com/speed/webp/download 4 | https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html 5 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_date = 0 4 | [metadata] 5 | description-file = README.md 6 | 7 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | with open('README.md') as f: 4 | long_description = f.read() 5 | 6 | setuptools.setup( 7 | name="webptools", 8 | version="0.0.9", 9 | scripts=['webptools/webplib.py'], 10 | author="scionoftech", 11 | description="webptools is a Webp image conversion package for python", 12 | long_description=long_description, 13 | long_description_content_type='text/markdown', 14 | url="https://github.com/scionoftech/webptools", 15 | packages=['webptools', 'lib', 'lib/libwebp_linux', 'lib/libwebp_osx', 16 | 'lib/libwebp_win64'], 17 | package_data={'': ['lib/*']}, 18 | include_package_data=True, 19 | keywords=['webp', 'converter', 'image'], 20 | install_requires=["uuid"], 21 | license='MIT', 22 | classifiers=[ 23 | 'Development Status :: 5 - Production/Stable', 24 | 'Programming Language :: Python', 25 | 'Programming Language :: Python :: 3.6', 26 | 'Programming Language :: Python :: 3.7', 27 | 'Programming Language :: Python :: 3.8', 28 | 'License :: OSI Approved :: MIT License', 29 | ], 30 | 31 | ) 32 | # packages=setuptools.find_packages(include=['lib', 'lib.*', 'frames']), 33 | # package_data = {'': ['*.py', 'lib/*']}, 34 | # include_package_data = True, 35 | # data_files = [('lib/*')], 36 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | from os import sep 2 | from pathlib import Path 3 | import base64 4 | from webptools import cwebp, dwebp, gifwebp, webpmux_add, webpmux_extract 5 | from webptools import webpmux_strip, webpmux_animate, webpmux_getframe 6 | from webptools import base64str2webp_base64str, grant_permission 7 | 8 | grant_permission() 9 | # *************** cwebp ************** # 10 | 11 | # pass input_image(.jpeg,.pnp .....) path , 12 | # output_image(give path where to save and image file name with .webp 13 | # file type extension) 14 | # print(cwebp( 15 | # f"{str(Path(__file__).parent.parent)}{sep}extras{sep}python_logo.jpg", 16 | # f"{str(Path(__file__).parent.parent)}{sep}extras{sep}python_logo.webp", 17 | # "-q 80",logging="-v",bin_path="/home/sky/Desktop/webp/lib/libwebp_linux/bin/cwebp")) 18 | 19 | # ******* dwebp ************ # 20 | 21 | # pass input_image(.webp image) path ,output_image(.jpeg,.pnp .....) 22 | print(dwebp( 23 | f"{str(Path(__file__).parent.parent)}{sep}extras{sep}python_logo.webp", 24 | f"{str(Path(__file__).parent.parent)}{sep}extras{sep}python_logo.jpg", 25 | "-o",logging="-v",bin_path="/home/sky/Desktop/webp/lib/libwebp_linux/bin/dwebp")) 26 | 27 | # ***************** gif2webp *********************** # 28 | 29 | # pass input_image(.gif) path ,output_image(give path where to save and 30 | # image file name with .webp file type extension) 31 | # print(gifwebp( 32 | # f"{str(Path(__file__).parent.parent)}{sep}extras{sep}linux_logo.gif", 33 | # f"{str(Path(__file__).parent.parent)}{sep}extras{sep}linux_logo.webp", 34 | # "-q 80")) 35 | 36 | # *************** webpmux ********************* # 37 | 38 | # %%%%%%%%%%%%%%%%%% Add ICC profile,XMP metadata and EXIF metadata 39 | 40 | # pass input_image(.webp image) path,output_image,set 41 | # options(icc image profile,XMP metadata or EXIF metadata) and file. 42 | # for options use keywords as below 43 | # for ICC: icc 44 | # for XMP metadata: xmp 45 | # for EXIF metadata: exif 46 | # print(webpmux_add("in.webp", "icc_container.webp", "image_profile.icc", "icc")) 47 | 48 | # %%%%%%%%%%%%%%%% Extract ICC profile,XMP metadata and EXIF metadata 49 | 50 | # pass input_image(.webp image) path,output_image,set 51 | # options(icc image profile,XMP metadata or EXIF metadata) and file. 52 | # for options use keywords as below 53 | # for ICC: icc 54 | # for XMP metadata: xmp 55 | # for EXIF metadata: exif 56 | # print(webpmux_extract("anim_container.webp", "image_profile.icc", "icc")) 57 | 58 | # %%%%%%%%%%%%%%%%%%%%% Strip ICC profile,XMP metadata and EXIF metadata 59 | 60 | # pass input_image(.webp image) path,output_image,set 61 | # options(icc image profile,XMP metadata or EXIF metadata) and file. 62 | # for options use keywords as below 63 | # for ICC: icc 64 | # for XMP metadata: xmp 65 | # for EXIF metadata: exif 66 | # print(webpmux_strip("icc_container.webp", "without_icc.webp", "icc")) 67 | 68 | # %%%%%%%%%%%%%%%%%%% Create an animated WebP file from Webp images 69 | 70 | # pass input_images(.webp image) path with FRAME_OPTIONS, 71 | # as array,ouput image will be animated .webp image 72 | 73 | # https://developers.google.com/speed/webp/docs/webpmux 74 | # FRAME_OPTIONS 75 | 76 | # -file_i +di[+xi+yi[+mi[bi]]] 77 | 78 | # e.g -frame one.webp +100 -frame two.webp +100+50+50 -frame three.webp 79 | # +100+50+50+1+b 80 | 81 | # Where: file_i is the i'th frame (WebP format), xi,yi specify the image 82 | # offset for this frame, 83 | # di is the pause duration before next frame, mi is the dispose method for 84 | # this frame (0 for NONE or 1 for BACKGROUND) 85 | # and bi is the blending method for this frame 86 | # (+b for BLEND or -b for NO_BLEND). 87 | # Argument bi can be omitted and will default to +b (BLEND). 88 | # Also, mi can be omitted if bi is omitted and 89 | # will default to 0 (NONE). Finally, 90 | # if mi and bi are omitted then xi and yi can be omitted and will default 91 | # to +0+0. 92 | 93 | # -loop n 94 | 95 | # e.g 10 96 | 97 | # Loop the frames n number of times. 0 indicates 98 | # the frames should loop forever. 99 | # Valid range is 0 to 65535 [Default: 0 (infinite)]. 100 | 101 | # -bgcolor A,R,G,B 102 | 103 | # e.g 255,255,255,255 104 | 105 | # Background color of the canvas. Where: A, R, G and B are integers 106 | # in the range 0 to 255 specifying 107 | # the Alpha, Red, Green and Blue component values respectively 108 | # [Default: 255,255,255,255]. 109 | 110 | # input = ["./frames/tmp-0.webp +100", "./frames/tmp-1.webp +100", 111 | # "./frames/tmp-2.webp +100"] 112 | # print(webpmux_animate(input, "anim_container.webp", "10", "255,255,255,255")) 113 | 114 | # %%%%%%%%%%%%%%%%%%%%% Get the a frame from an animated WebP file 115 | 116 | # pass input_image(.webp image) path ,output_image and frame number 117 | # print(webpmux_getframe("anim_container.webp", "frame_2.webp", "2")) 118 | 119 | # *************** base64 to webp base64 ************** # 120 | 121 | # with open( 122 | # r"C:\Users\user\python_logo.jpg", 123 | # "rb") as image_file: 124 | # encoded_string = base64.b64encode(image_file.read()) 125 | # base64_image = encoded_string.decode('utf-8') 126 | # 127 | # print(str2webpstr(base64str=base64_image, image_type="jpg", 128 | # option="-q 80", logging="-v")) 129 | -------------------------------------------------------------------------------- /webptools/__init__.py: -------------------------------------------------------------------------------- 1 | from .webplib import cwebp, dwebp, gifwebp, webpmux_add, webpmux_extract 2 | from .webplib import webpmux_strip, webpmux_animate, webpmux_getframe 3 | from .webplib import base64str2webp_base64str, grant_permission 4 | -------------------------------------------------------------------------------- /webptools/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/webptools/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /webptools/__pycache__/webpbin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/webptools/__pycache__/webpbin.cpython-36.pyc -------------------------------------------------------------------------------- /webptools/__pycache__/webplib.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scionoftech/webptools/97abffa60988bf5a0d5d2edc0fbd6dc22ad218cf/webptools/__pycache__/webplib.cpython-36.pyc -------------------------------------------------------------------------------- /webptools/webpbin.py: -------------------------------------------------------------------------------- 1 | import platform 2 | from typing import Any 3 | from os.path import dirname, abspath 4 | 5 | 6 | def getcwebp(bin_path: Any) -> Any: 7 | if bin_path is None: 8 | if platform.system() == 'Linux': 9 | return dirname( 10 | dirname(abspath(__file__))) + '/lib/libwebp_linux/bin/cwebp' 11 | elif platform.system() == 'Windows': 12 | arch = platform.architecture() 13 | if arch[0] == '64bit': 14 | return dirname(dirname( 15 | abspath(__file__))) + '/lib/libwebp_win64/bin/cwebp.exe' 16 | elif arch[0] in ('32bit', '86bit'): 17 | print('Unsupported platform:', platform.system(), 18 | platform.architecture()) 19 | elif platform.system() == 'Darwin': 20 | return dirname( 21 | dirname(abspath(__file__))) + '/lib/libwebp_osx/bin/cwebp' 22 | else: 23 | print('Unsupported platform:', platform.system(), 24 | platform.architecture()) 25 | else: 26 | return bin_path 27 | 28 | 29 | def getdwebp(bin_path: Any) -> Any: 30 | if bin_path is None: 31 | if platform.system() == 'Linux': 32 | return dirname( 33 | dirname(abspath(__file__))) + '/lib/libwebp_linux/bin/dwebp' 34 | elif platform.system() == 'Windows': 35 | arch = platform.architecture() 36 | if arch[0] == '64bit': 37 | return dirname(dirname( 38 | abspath(__file__))) + '/lib/libwebp_win64/bin/dwebp.exe' 39 | elif arch[0] == '32bit' and arch[0] == '86bit': 40 | print('Unsupported platform:', platform.system(), 41 | platform.architecture()) 42 | elif platform.system() == 'Darwin': 43 | return dirname( 44 | dirname(abspath(__file__))) + '/lib/libwebp_osx/bin/dwebp' 45 | else: 46 | print('Unsupported platform:', platform.system(), 47 | platform.architecture()) 48 | else: 49 | return bin_path 50 | 51 | 52 | def getgifwebp(bin_path: Any) -> Any: 53 | if bin_path is None: 54 | if platform.system() == 'Linux': 55 | return dirname( 56 | dirname(abspath(__file__))) + '/lib/libwebp_linux/bin/gif2webp' 57 | elif platform.system() == 'Windows': 58 | arch = platform.architecture() 59 | if arch[0] == '64bit': 60 | return dirname(dirname( 61 | abspath(__file__))) + '/lib/libwebp_win64/bin/gif2webp.exe' 62 | elif arch[0] in ('32bit', '86bit'): 63 | print('Unsupported platform:', platform.system(), 64 | platform.architecture()) 65 | elif platform.system() == 'Darwin': 66 | return dirname( 67 | dirname(abspath(__file__))) + '/lib/libwebp_osx/bin/gif2webp' 68 | else: 69 | print('Unsupported platform:', platform.system(), 70 | platform.architecture()) 71 | else: 72 | return bin_path 73 | 74 | 75 | def getwebpmux(bin_path: Any) -> Any: 76 | if bin_path is None: 77 | if platform.system() == 'Linux': 78 | return dirname( 79 | dirname(abspath(__file__))) + '/lib/libwebp_linux/bin/webpmux' 80 | elif platform.system() == 'Windows': 81 | arch = platform.architecture() 82 | if arch[0] == '64bit': 83 | return dirname(dirname( 84 | abspath(__file__))) + '/lib/libwebp_win64/bin/webpmux.exe' 85 | elif arch[0] in ('32bit', '86bit'): 86 | print('Unsupported platform:', platform.system(), 87 | platform.architecture()) 88 | elif platform.system() == 'Darwin': 89 | return dirname( 90 | dirname(abspath(__file__))) + '/lib/libwebp_osx/bin/webpmux' 91 | else: 92 | print('Unsupported platform:', platform.system(), 93 | platform.architecture()) 94 | else: 95 | return bin_path 96 | -------------------------------------------------------------------------------- /webptools/webplib.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | from pathlib import Path 3 | import os 4 | import uuid 5 | import base64 6 | from typing import Tuple 7 | from typing import Dict, List 8 | from .webpbin import getcwebp, getdwebp, getgifwebp, getwebpmux 9 | 10 | 11 | def grant_permission(): 12 | """ 13 | Change permission of webp executables to 755 14 | :return: 15 | """ 16 | files = [getcwebp(bin_path=None), getdwebp(bin_path=None), getgifwebp(bin_path=None), getwebpmux(bin_path=None)] 17 | for file in files: 18 | os.chmod(file, 0o755) 19 | 20 | 21 | def temp_file_path() -> str: 22 | """ 23 | Get Temp folder path 24 | :return: 25 | """ 26 | return f"{get_project_path()}{os.sep}temp{os.sep}" 27 | 28 | 29 | # get project root path 30 | def get_project_path() -> str: 31 | """ 32 | Get root folder path 33 | :return: 34 | """ 35 | return str( 36 | Path(__file__).parent.parent) 37 | 38 | 39 | def base64str2webp_base64str(base64str: str, image_type: str, option: str, 40 | temp_path: str = None, 41 | logging: str = "-v", bin_path: str = None) -> Tuple: 42 | """ 43 | Convert bas64 image to webp base64 44 | :param base64str: 45 | :param image_type: 46 | :param option: 47 | :param temp_path: 48 | :param logging: 49 | :param bin_path: 50 | :return: 51 | """ 52 | if not temp_path: 53 | temp_path = temp_file_path() 54 | 55 | filename = uuid.uuid4().hex 56 | 57 | input_file = f"{temp_path}{filename}.{image_type}" 58 | output_file = f"{temp_path}{filename}.webp" 59 | 60 | imgdata = base64.b64decode(base64str) 61 | 62 | with open(input_file, 'wb') as f: 63 | f.write(imgdata) 64 | 65 | results = cwebp(input_image=input_file, output_image=output_file, 66 | option=option, logging=logging, bin_path=bin_path) 67 | 68 | if results["exit_code"] == 0: 69 | with open(output_file, "rb") as image_file: 70 | encoded_string = base64.b64encode(image_file.read()) 71 | 72 | for fpath in [input_file, output_file]: 73 | file_to_rem = Path(fpath) 74 | if file_to_rem.exists(): 75 | file_to_rem.unlink() 76 | return encoded_string.decode('utf-8'), results 77 | else: 78 | return None, results 79 | 80 | 81 | # ****************** cwebp *********************** # 82 | 83 | def cwebp(input_image: str, output_image: str, option: str, 84 | logging: str = "-v", bin_path: str = None) -> Dict: 85 | """ 86 | now convert image to .webp format 87 | 88 | input_image: input image(.jpeg, .pnp ....) 89 | output_image: output image .webp 90 | option: options and quality,it should be given between 0 to 100 91 | 92 | :param input_image: 93 | :param output_image: 94 | :param option: 95 | :param logging: 96 | :param bin_path: 97 | :return: 98 | """ 99 | cmd = f"{getcwebp(bin_path=bin_path)} {option} {input_image} -o {output_image} {logging}" 100 | p = subprocess.Popen(cmd, shell=True, stdin=None, stdout=subprocess.PIPE, 101 | stderr=subprocess.PIPE) 102 | (stdout, stderr) = p.communicate() 103 | result = {'exit_code': p.returncode, 'stdout': stdout, 'stderr': stderr, 104 | 'command': cmd} 105 | return result 106 | 107 | 108 | # ****************** dwebp *********************** # 109 | 110 | def dwebp(input_image: str, output_image: str, option: str, 111 | logging: str = "-v", bin_path: str = None) -> Dict: 112 | """ 113 | now convert .webp to other image format 114 | 115 | input_image: input image .webp 116 | output_image: output image(.jpeg, .pnp ....) 117 | option: options and quality,it should be given between 0 to 100 118 | :param input_image: 119 | :param output_image: 120 | :param option: 121 | :param logging: 122 | :param bin_path: 123 | :return: 124 | """ 125 | cmd = f"{getdwebp(bin_path=bin_path)} {input_image} {option} {output_image} {logging}" 126 | p = subprocess.Popen(cmd, shell=True, stdin=None, stdout=subprocess.PIPE, 127 | stderr=subprocess.PIPE) 128 | (stdout, stderr) = p.communicate() 129 | result = {'exit_code': p.returncode, 'stdout': stdout, 'stderr': stderr, 130 | 'command': cmd} 131 | return result 132 | 133 | 134 | # ****************** gif2webp *********************** # 135 | 136 | def gifwebp(input_image: str, output_image: str, option: str, 137 | logging: str = "-v", bin_path: str = None) -> Dict: 138 | """ 139 | now convert .gif image to .webp format 140 | 141 | input_image: input image(.jpeg, .pnp ....) 142 | output_image: /output image .webp 143 | option: options and quality,it should be given between 0 to 100 144 | :param input_image: 145 | :param output_image: 146 | :param option: 147 | :param logging: 148 | :param bin_path: 149 | :return: 150 | """ 151 | cmd = f"{getgifwebp(bin_path=bin_path)} {option} {input_image} -o {output_image} {logging}" 152 | p = subprocess.Popen(cmd, shell=True, stdin=None, stdout=subprocess.PIPE, 153 | stderr=subprocess.PIPE) 154 | (stdout, stderr) = p.communicate() 155 | result = {'exit_code': p.returncode, 'stdout': stdout, 'stderr': stderr, 156 | 'command': cmd} 157 | return result 158 | 159 | 160 | # ****************** webpmux *********************** # 161 | 162 | def webpmux_add(input_image: str, output_image: str, icc_profile: str, 163 | option: str, logging: str = "", bin_path: str = None) -> Dict: 164 | """ 165 | Add ICC profile,XMP metadata and EXIF metadata # 166 | 167 | input_image: input image(.webp) 168 | output_image: output image .webp 169 | icc_profile: icc profile 170 | option: get or set option (icc,xmp,exif) 171 | :param input_image: 172 | :param output_image: 173 | :param icc_profile: 174 | :param option: 175 | :param logging: 176 | :param bin_path: 177 | :return: 178 | """ 179 | cmd = f"{getwebpmux(bin_path=bin_path)} -set {option} {icc_profile} {input_image} -o {output_image} {logging}" 180 | p = subprocess.Popen(cmd, shell=True, stdin=None, stdout=subprocess.PIPE, 181 | stderr=subprocess.PIPE) 182 | (stdout, stderr) = p.communicate() 183 | result = {'exit_code': p.returncode, 'stdout': stdout, 'stderr': stderr, 184 | 'command': cmd} 185 | return result 186 | 187 | 188 | def webpmux_extract(input_image: str, icc_profile: str, option: str, 189 | logging: str = "", bin_path: str = None) -> Dict: 190 | """ 191 | Extract ICC profile,XMP metadata and EXIF metadata 192 | 193 | input_image: input image(.webp) 194 | icc_profile: icc profile 195 | :param input_image: 196 | :param icc_profile: 197 | :param option: 198 | :param logging: 199 | :param bin_path: 200 | :return: 201 | """ 202 | cmd = f"{getwebpmux(bin_path=bin_path)} -get {option} {input_image} -o {icc_profile} {logging}" 203 | p = subprocess.Popen(cmd, shell=True, stdin=None, stdout=subprocess.PIPE, 204 | stderr=subprocess.PIPE) 205 | (stdout, stderr) = p.communicate() 206 | result = {'exit_code': p.returncode, 'stdout': stdout, 'stderr': stderr, 207 | 'command': cmd} 208 | return result 209 | 210 | 211 | def webpmux_strip(input_image: str, output_image: str, option: str, 212 | logging: str = "", bin_path: str = None) -> Dict: 213 | """ 214 | Strip ICC profile,XMP metadata and EXIF metadata 215 | 216 | input_image: input image(.webp) 217 | output_image: output image .webp 218 | :param input_image: 219 | :param output_image: 220 | :param option: 221 | :param logging: 222 | :param bin_path: 223 | :return: 224 | """ 225 | cmd = f"{getwebpmux(bin_path=bin_path)} -strip {option} {input_image} -o {output_image} {logging}" 226 | p = subprocess.Popen(cmd, shell=True, stdin=None, stdout=subprocess.PIPE, 227 | stderr=subprocess.PIPE) 228 | (stdout, stderr) = p.communicate() 229 | result = {'exit_code': p.returncode, 'stdout': stdout, 'stderr': stderr, 230 | 'command': cmd} 231 | return result 232 | 233 | 234 | def webpmux_animate(input_images: List, output_image: str, loop: str, 235 | bgcolor: str, logging: str = "", bin_path: str = None) -> Dict: 236 | """ 237 | Create an animated WebP file from Webp images 238 | 239 | input_images: array of image(.webp) 240 | output_image: animatedimage .webp 241 | loop:Loop the frames n number of times 242 | bgcolor: Background color of the canvas 243 | :param input_images: 244 | :param output_image: 245 | :param loop: 246 | :param bgcolor: 247 | :param logging: 248 | :param bin_path: 249 | :return: 250 | """ 251 | files = "" 252 | for frame in input_images: 253 | files += f" -frame {frame}" 254 | 255 | cmd = f"{getwebpmux(bin_path=bin_path)} {files} -loop {loop} -bgcolor {bgcolor} -o {output_image} {logging}" 256 | p = subprocess.Popen(cmd, shell=True, stdin=None, stdout=subprocess.PIPE, 257 | stderr=subprocess.PIPE) 258 | (stdout, stderr) = p.communicate() 259 | result = {'exit_code': p.returncode, 'stdout': stdout, 'stderr': stderr, 260 | 'command': cmd} 261 | return result 262 | 263 | 264 | def webpmux_getframe(input_image: str, output_image: str, 265 | frame_number: str, logging: str = "", bin_path: str = None) -> Dict: 266 | """ 267 | Get the a frame from an animated WebP file 268 | 269 | input_image: input image(.webp) 270 | output_image: output image .webp 271 | frame_number: frame number 272 | :param input_image: 273 | :param output_image: 274 | :param frame_number: 275 | :param logging: 276 | :param bin_path: 277 | :return: 278 | """ 279 | cmd = f"{getwebpmux(bin_path=bin_path)} -get frame {frame_number} {input_image} -o {output_image} {logging}" 280 | p = subprocess.Popen(cmd, shell=True, stdin=None, stdout=subprocess.PIPE, 281 | stderr=subprocess.PIPE) 282 | (stdout, stderr) = p.communicate() 283 | result = {'exit_code': p.returncode, 'stdout': stdout, 'stderr': stderr, 284 | 'command': cmd} 285 | return result 286 | --------------------------------------------------------------------------------