2012-01-06 23:49:06 +01:00
|
|
|
// Copyright 2011 Google Inc. All Rights Reserved.
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
//
|
2013-06-07 08:05:58 +02:00
|
|
|
// Use of this source code is governed by a BSD-style license
|
|
|
|
// that can be found in the COPYING file in the root of the source
|
|
|
|
// tree. An additional intellectual property rights grant can be found
|
|
|
|
// in the file PATENTS. All contributing project authors may
|
|
|
|
// be found in the AUTHORS file in the root of the source tree.
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Alpha-plane decompression.
|
|
|
|
//
|
|
|
|
// Author: Skal (pascal.massimino@gmail.com)
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2013-06-12 01:04:54 +02:00
|
|
|
#include "./alphai.h"
|
2011-12-01 04:27:36 +01:00
|
|
|
#include "./vp8i.h"
|
2012-05-23 17:01:44 +02:00
|
|
|
#include "./vp8li.h"
|
2015-01-28 08:02:41 +01:00
|
|
|
#include "../dsp/dsp.h"
|
2013-02-14 07:21:41 +01:00
|
|
|
#include "../utils/quant_levels_dec.h"
|
2014-03-27 23:27:32 +01:00
|
|
|
#include "../utils/utils.h"
|
2012-05-24 11:21:37 +02:00
|
|
|
#include "../webp/format_constants.h"
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
|
2012-05-21 15:22:06 +02:00
|
|
|
//------------------------------------------------------------------------------
|
2013-06-12 01:04:54 +02:00
|
|
|
// ALPHDecoder object.
|
|
|
|
|
|
|
|
ALPHDecoder* ALPHNew(void) {
|
2014-03-27 23:27:32 +01:00
|
|
|
ALPHDecoder* const dec = (ALPHDecoder*)WebPSafeCalloc(1ULL, sizeof(*dec));
|
2013-06-12 01:04:54 +02:00
|
|
|
return dec;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ALPHDelete(ALPHDecoder* const dec) {
|
|
|
|
if (dec != NULL) {
|
|
|
|
VP8LDelete(dec->vp8l_dec_);
|
|
|
|
dec->vp8l_dec_ = NULL;
|
2014-03-27 23:27:32 +01:00
|
|
|
WebPSafeFree(dec);
|
2013-06-12 01:04:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Decoding.
|
|
|
|
|
|
|
|
// Initialize alpha decoding by parsing the alpha header and decoding the image
|
|
|
|
// header for alpha data stored using lossless compression.
|
|
|
|
// Returns false in case of error in alpha header (data too short, invalid
|
|
|
|
// compression method or filter, error in lossless header data etc).
|
|
|
|
static int ALPHInit(ALPHDecoder* const dec, const uint8_t* data,
|
|
|
|
size_t data_size, int width, int height, uint8_t* output) {
|
2012-05-21 15:22:06 +02:00
|
|
|
int ok = 0;
|
2013-05-03 03:24:46 +02:00
|
|
|
const uint8_t* const alpha_data = data + ALPHA_HEADER_LEN;
|
|
|
|
const size_t alpha_data_size = data_size - ALPHA_HEADER_LEN;
|
2013-06-12 01:04:54 +02:00
|
|
|
int rsrv;
|
2012-05-21 15:22:06 +02:00
|
|
|
|
2013-05-03 03:24:46 +02:00
|
|
|
assert(width > 0 && height > 0);
|
2012-05-21 15:22:06 +02:00
|
|
|
assert(data != NULL && output != NULL);
|
|
|
|
|
2013-06-12 01:04:54 +02:00
|
|
|
dec->width_ = width;
|
|
|
|
dec->height_ = height;
|
|
|
|
|
2012-05-21 15:22:06 +02:00
|
|
|
if (data_size <= ALPHA_HEADER_LEN) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-06-12 01:04:54 +02:00
|
|
|
dec->method_ = (data[0] >> 0) & 0x03;
|
|
|
|
dec->filter_ = (data[0] >> 2) & 0x03;
|
|
|
|
dec->pre_processing_ = (data[0] >> 4) & 0x03;
|
2012-05-22 11:36:22 +02:00
|
|
|
rsrv = (data[0] >> 6) & 0x03;
|
2013-06-12 01:04:54 +02:00
|
|
|
if (dec->method_ < ALPHA_NO_COMPRESSION ||
|
|
|
|
dec->method_ > ALPHA_LOSSLESS_COMPRESSION ||
|
|
|
|
dec->filter_ >= WEBP_FILTER_LAST ||
|
|
|
|
dec->pre_processing_ > ALPHA_PREPROCESSED_LEVELS ||
|
2012-05-22 11:36:22 +02:00
|
|
|
rsrv != 0) {
|
2012-05-21 15:22:06 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-06-12 01:04:54 +02:00
|
|
|
if (dec->method_ == ALPHA_NO_COMPRESSION) {
|
|
|
|
const size_t alpha_decoded_size = dec->width_ * dec->height_;
|
2013-05-03 03:24:46 +02:00
|
|
|
ok = (alpha_data_size >= alpha_decoded_size);
|
2012-05-21 15:22:06 +02:00
|
|
|
} else {
|
2013-06-12 01:04:54 +02:00
|
|
|
assert(dec->method_ == ALPHA_LOSSLESS_COMPRESSION);
|
|
|
|
ok = VP8LDecodeAlphaHeader(dec, alpha_data, alpha_data_size, output);
|
2012-05-21 15:22:06 +02:00
|
|
|
}
|
2015-01-28 08:02:41 +01:00
|
|
|
VP8FiltersInit();
|
2013-06-12 01:04:54 +02:00
|
|
|
return ok;
|
|
|
|
}
|
2012-05-21 15:22:06 +02:00
|
|
|
|
2013-06-12 01:04:54 +02:00
|
|
|
// Decodes, unfilters and dequantizes *at least* 'num_rows' rows of alpha
|
2013-11-27 04:21:14 +01:00
|
|
|
// starting from row number 'row'. It assumes that rows up to (row - 1) have
|
2013-06-12 01:04:54 +02:00
|
|
|
// already been decoded.
|
|
|
|
// Returns false in case of bitstream error.
|
|
|
|
static int ALPHDecode(VP8Decoder* const dec, int row, int num_rows) {
|
|
|
|
ALPHDecoder* const alph_dec = dec->alph_dec_;
|
|
|
|
const int width = alph_dec->width_;
|
|
|
|
const int height = alph_dec->height_;
|
|
|
|
WebPUnfilterFunc unfilter_func = WebPUnfilters[alph_dec->filter_];
|
|
|
|
uint8_t* const output = dec->alpha_plane_;
|
|
|
|
if (alph_dec->method_ == ALPHA_NO_COMPRESSION) {
|
|
|
|
const size_t offset = row * width;
|
|
|
|
const size_t num_pixels = num_rows * width;
|
|
|
|
assert(dec->alpha_data_size_ >= ALPHA_HEADER_LEN + offset + num_pixels);
|
|
|
|
memcpy(dec->alpha_plane_ + offset,
|
|
|
|
dec->alpha_data_ + ALPHA_HEADER_LEN + offset, num_pixels);
|
|
|
|
} else { // alph_dec->method_ == ALPHA_LOSSLESS_COMPRESSION
|
|
|
|
assert(alph_dec->vp8l_dec_ != NULL);
|
|
|
|
if (!VP8LDecodeAlphaImageStream(alph_dec, row + num_rows)) {
|
|
|
|
return 0;
|
2012-05-21 15:22:06 +02:00
|
|
|
}
|
2013-06-12 01:04:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (unfilter_func != NULL) {
|
|
|
|
unfilter_func(width, height, width, row, num_rows, output);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (row + num_rows == dec->pic_hdr_.height_) {
|
|
|
|
dec->is_alpha_decoded_ = 1;
|
|
|
|
}
|
|
|
|
return 1;
|
2012-05-21 15:22:06 +02:00
|
|
|
}
|
|
|
|
|
2011-08-25 23:22:32 +02:00
|
|
|
//------------------------------------------------------------------------------
|
2013-06-12 01:04:54 +02:00
|
|
|
// Main entry point.
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
|
|
|
|
const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec,
|
2016-03-18 15:36:58 +01:00
|
|
|
const VP8Io* const io,
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
int row, int num_rows) {
|
2013-05-03 03:24:46 +02:00
|
|
|
const int width = dec->pic_hdr_.width_;
|
|
|
|
const int height = dec->pic_hdr_.height_;
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
|
2016-03-18 15:36:58 +01:00
|
|
|
assert(dec != NULL && io != NULL);
|
|
|
|
|
2013-06-12 01:04:54 +02:00
|
|
|
if (row < 0 || num_rows <= 0 || row + num_rows > height) {
|
2011-12-01 04:27:36 +01:00
|
|
|
return NULL; // sanity check.
|
|
|
|
}
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
|
2016-03-18 15:36:58 +01:00
|
|
|
if (dec->alph_dec_ == NULL) { // Initialize decoder.
|
2013-06-12 01:04:54 +02:00
|
|
|
assert(dec->alpha_plane_ != NULL);
|
|
|
|
dec->alph_dec_ = ALPHNew();
|
|
|
|
if (dec->alph_dec_ == NULL) return NULL;
|
|
|
|
if (!ALPHInit(dec->alph_dec_, dec->alpha_data_, dec->alpha_data_size_,
|
|
|
|
width, height, dec->alpha_plane_)) {
|
|
|
|
ALPHDelete(dec->alph_dec_);
|
|
|
|
dec->alph_dec_ = NULL;
|
|
|
|
return NULL;
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
}
|
2014-06-14 00:06:16 +02:00
|
|
|
// if we allowed use of alpha dithering, check whether it's needed at all
|
|
|
|
if (dec->alph_dec_->pre_processing_ != ALPHA_PREPROCESSED_LEVELS) {
|
|
|
|
dec->alpha_dithering_ = 0; // disable dithering
|
|
|
|
} else {
|
|
|
|
num_rows = height; // decode everything in one pass
|
|
|
|
}
|
2013-06-12 01:04:54 +02:00
|
|
|
}
|
|
|
|
|
2016-03-18 15:36:58 +01:00
|
|
|
if (io->use_cropping) {
|
|
|
|
if (row + num_rows > io->crop_bottom) {
|
|
|
|
num_rows = io->crop_bottom - row;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-12 01:04:54 +02:00
|
|
|
if (!dec->is_alpha_decoded_) {
|
2016-03-18 15:36:58 +01:00
|
|
|
int ok = ALPHDecode(dec, row, num_rows);
|
2013-06-12 01:04:54 +02:00
|
|
|
assert(dec->alph_dec_ != NULL);
|
2014-06-14 00:06:16 +02:00
|
|
|
if (ok && dec->alpha_dithering_ > 0) {
|
2016-03-18 15:36:58 +01:00
|
|
|
ok = WebPDequantizeLevels(dec->alpha_plane_, width, height, width,
|
2014-06-14 00:06:16 +02:00
|
|
|
dec->alpha_dithering_);
|
|
|
|
}
|
2013-06-12 01:04:54 +02:00
|
|
|
if (!ok || dec->is_alpha_decoded_) {
|
|
|
|
ALPHDelete(dec->alph_dec_);
|
|
|
|
dec->alph_dec_ = NULL;
|
|
|
|
}
|
|
|
|
if (!ok) return NULL; // Error.
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
}
|
2011-12-01 04:27:36 +01:00
|
|
|
// Return a pointer to the current decoded row.
|
2013-05-03 03:24:46 +02:00
|
|
|
return dec->alpha_plane_ + row * width;
|
EXPERIMENTAL: add support for alpha channel
This is a (minor) bitstream change: if the 'color_space' bit is set to '1'
(which is normally an undefined/invalid behaviour), we add extra data at the
end of partition #0 (so-called 'extensions')
Namely, we add the size of the extension data as 3 bytes (little-endian),
followed by a set of bits telling which extensions we're incorporating.
The data then _preceeds_ this trailing tags.
This is all experimental, and you'll need to have
'#define WEBP_EXPERIMENTAL_FEATURES' in webp/types.h to enable this code
(at your own risk! :))
Still, this hack produces almost-valid WebP file for decoders that don't
check this color_space bit. In particular, previous 'dwebp' (and for instance
Chrome) will recognize this files and decode them, but without the alpha
of course. Other decoder will just see random extra stuff at the end of
partition #0.
To experiment with the alpha-channel, you need to compile on Unix platform
and use PNGs for input/output.
If 'alpha.png' is a source with alpha channel, then you can try (on Unix):
cwebp alpha.png -o alpha.webp
dwebp alpha.webp -o test.png
cwebp now has a '-noalpha' flag to ignore any alpha information from the
source, if present.
More hacking and experimenting welcome!
Change-Id: I3c7b1fd8411c9e7a9f77690e898479ad85c52f3e
2011-04-26 01:58:04 +02:00
|
|
|
}
|