2011-09-30 07:19:26 +02:00
|
|
|
__ __ ____ ____ ____ __ __ _ __ __
|
|
|
|
/ \\/ \/ _ \/ _ \/ _ \/ \ \/ \___/_ / _\
|
|
|
|
\ / __/ _ \ __/ / / (_/ /__
|
|
|
|
\__\__/\_____/_____/__/ \__//_/\_____/__/___/
|
|
|
|
|
|
|
|
|
|
|
|
Description:
|
|
|
|
============
|
|
|
|
|
2012-02-17 23:39:31 +01:00
|
|
|
WebP Mux: library to create a WebP container object for features like
|
2012-01-24 21:46:46 +01:00
|
|
|
color profile, XMP metadata, animation & tiling. A reference command line
|
2012-02-17 23:39:31 +01:00
|
|
|
tool 'webpmux' and WebP container specification 'doc/webp-container-spec.txt'
|
2012-01-24 21:46:46 +01:00
|
|
|
are also provided in this package.
|
2011-09-30 07:19:26 +02:00
|
|
|
|
|
|
|
WebP Mux tool:
|
|
|
|
==============
|
|
|
|
|
2012-02-17 23:39:31 +01:00
|
|
|
The examples/ directory contains a tool (webpmux) for manipulating WebP
|
|
|
|
files. The webpmux tool can be used to create a WebP container file and to
|
2012-01-24 21:46:46 +01:00
|
|
|
extract or strip relevant data from the container file.
|
2011-09-30 07:19:26 +02:00
|
|
|
|
|
|
|
A list of options is available using the -help command line flag:
|
|
|
|
|
|
|
|
> webpmux -help
|
|
|
|
Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT
|
2012-01-24 21:46:46 +01:00
|
|
|
webpmux -set SET_OPTIONS INPUT -o OUTPUT
|
|
|
|
webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT
|
|
|
|
webpmux -tile TILE_OPTIONS [-tile...] -o OUTPUT
|
|
|
|
webpmux -frame FRAME_OPTIONS [-frame...] -loop LOOP_COUNT -o OUTPUT
|
|
|
|
webpmux -info INPUT
|
|
|
|
webpmux [-h|-help]
|
2011-09-30 07:19:26 +02:00
|
|
|
|
|
|
|
GET_OPTIONS:
|
2012-01-24 21:46:46 +01:00
|
|
|
Extract relevant data.
|
2011-09-30 07:19:26 +02:00
|
|
|
icc Get ICCP Color profile.
|
|
|
|
xmp Get XMP metadata.
|
|
|
|
tile n Get nth tile.
|
|
|
|
frame n Get nth frame.
|
|
|
|
|
|
|
|
SET_OPTIONS:
|
2012-01-24 21:46:46 +01:00
|
|
|
Set color profile/metadata.
|
2011-09-30 07:19:26 +02:00
|
|
|
icc Set ICC Color profile.
|
|
|
|
xmp Set XMP metadata.
|
|
|
|
|
|
|
|
STRIP_OPTIONS:
|
2012-01-24 21:46:46 +01:00
|
|
|
Strip color profile/metadata.
|
2011-09-30 07:19:26 +02:00
|
|
|
icc Strip ICCP color profile.
|
|
|
|
xmp Strip XMP metadata.
|
|
|
|
|
|
|
|
TILE_OPTIONS(i):
|
2012-01-24 21:46:46 +01:00
|
|
|
Create tiled image.
|
2011-09-30 07:19:26 +02:00
|
|
|
file_i +xi+yi
|
|
|
|
where: 'file_i' is the i'th tile (webp format),
|
|
|
|
'xi','yi' specify the image offset for this tile.
|
|
|
|
|
|
|
|
FRAME_OPTIONS(i):
|
2012-01-24 21:46:46 +01:00
|
|
|
Create animation.
|
2011-09-30 07:19:26 +02:00
|
|
|
file_i +xi+yi+di
|
|
|
|
where: 'file_i' is the i'th animation frame (webp format),
|
|
|
|
'xi','yi' specify the image offset for this frame.
|
|
|
|
'di' is the pause duration before next frame.
|
|
|
|
|
|
|
|
INPUT & OUTPUT are in webp format.
|
|
|
|
|
|
|
|
WebP Mux API:
|
|
|
|
==============
|
2012-02-17 23:39:31 +01:00
|
|
|
The WebP Mux API contains methods for adding data to and reading data from
|
|
|
|
WebPMux (a WebP container object). This API currently supports XMP metadata,
|
|
|
|
color profile, animation & tiling. Other features will be added in subsequent
|
|
|
|
releases.
|
2011-09-30 07:19:26 +02:00
|
|
|
|
2012-02-17 23:39:31 +01:00
|
|
|
Example#1 (pseudo code): Creating a WebPMux object with image data, color
|
|
|
|
profile & XMP metadata.
|
2011-09-30 07:19:26 +02:00
|
|
|
|
|
|
|
int copy_data = 0;
|
|
|
|
WebPMux* mux = WebPMuxNew();
|
|
|
|
// ... (Prepare image data).
|
2012-06-20 19:59:40 +02:00
|
|
|
WebPMuxSetImage(mux, &image, copy_data);
|
2011-09-30 07:19:26 +02:00
|
|
|
// ... (Prepare ICCP color profile data).
|
2012-06-05 16:58:03 +02:00
|
|
|
WebPMuxSetColorProfile(mux, &icc_profile, copy_data);
|
2011-09-30 07:19:26 +02:00
|
|
|
// ... (Prepare XMP metadata).
|
2012-06-05 16:58:03 +02:00
|
|
|
WebPMuxSetMetadata(mux, &xmp, copy_data);
|
2011-09-30 07:19:26 +02:00
|
|
|
// Get data from mux in WebP RIFF format.
|
2012-06-07 07:34:57 +02:00
|
|
|
WebPMuxAssemble(mux, &output_data);
|
2011-09-30 07:19:26 +02:00
|
|
|
WebPMuxDelete(mux);
|
2012-06-07 07:34:57 +02:00
|
|
|
// ... (Consume output_data; e.g. write output_data.bytes_ to file).
|
|
|
|
WebPDataClear(&output_data);
|
2011-09-30 07:19:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
Example#2 (pseudo code): Get image & color profile data from a WebP file.
|
|
|
|
|
|
|
|
int copy_data = 0;
|
|
|
|
// ... (Read data from file).
|
2012-06-05 16:58:03 +02:00
|
|
|
WebPMux* mux = WebPMuxCreate(&data, copy_data);
|
2012-06-20 19:59:40 +02:00
|
|
|
WebPMuxGetImage(mux, &image);
|
2012-01-07 21:44:01 +01:00
|
|
|
// ... (Consume image; e.g. call WebPDecode() to decode the data).
|
2012-06-05 16:58:03 +02:00
|
|
|
WebPMuxGetColorProfile(mux, &icc_profile);
|
|
|
|
// ... (Consume icc_profile).
|
2011-09-30 07:19:26 +02:00
|
|
|
WebPMuxDelete(mux);
|
|
|
|
free(data);
|
|
|
|
|
|
|
|
|
2012-02-17 23:39:31 +01:00
|
|
|
For detailed Mux API reference, please refer to the header file (src/webp/mux.h)
|
2011-09-30 07:19:26 +02:00
|
|
|
|
|
|
|
Bugs:
|
|
|
|
=====
|
|
|
|
|
|
|
|
Please report all bugs to our issue tracker:
|
|
|
|
http://code.google.com/p/webp/issues
|
|
|
|
Patches welcome! See this page to get started:
|
|
|
|
http://www.webmproject.org/code/contribute/submitting-patches/
|
|
|
|
|
|
|
|
Discuss:
|
|
|
|
========
|
|
|
|
|
|
|
|
Email: webp-discuss@webmproject.org
|
|
|
|
Web: http://groups.google.com/a/webmproject.org/group/webp-discuss
|