Alien-FreeImage

 view release on metacpan or  search on metacpan

src/Source/LibWebP/README  view on Meta::CPAN

 cd examples
 ./dwebp test.webp -ppm -o test.ppm
 diff test.ppm test_ref.ppm

The full list of options is available using -h:

> dwebp -h
Usage: dwebp in_file [options] [-o out_file]

Decodes the WebP image file to PNG format [Default]
Use following options to convert into alternate image formats:
  -pam ......... save the raw RGBA samples as a color PAM
  -ppm ......... save the raw RGB samples as a color PPM
  -bmp ......... save as uncompressed BMP format
  -tiff ........ save as uncompressed TIFF format
  -pgm ......... save the raw YUV samples as a grayscale PGM
                 file with IMC4 layout
  -yuv ......... save the raw YUV samples in flat layout

 Other options are:
  -version  .... print version number and exit
  -nofancy ..... don't use the fancy YUV420 upscaler
  -nofilter .... disable in-loop filtering
  -nodither .... disable dithering
  -dither <d> .. dithering strength (in 0..100)
  -alpha_dither  use alpha-plane dithering if needed
  -mt .......... use multi-threading
  -crop <x> <y> <w> <h> ... crop output with the given rectangle
  -scale <w> <h> .......... scale the output (*after* any cropping)
  -flip ........ flip the output vertically
  -alpha ....... only save the alpha plane
  -incremental . use incremental decoding (useful for tests)
  -h     ....... this help message
  -v     ....... verbose (e.g. print encoding/decoding times)
  -noasm ....... disable all assembly optimizations

Visualization tool:
===================

There's a little self-serve visualization tool called 'vwebp' under the
examples/ directory. It uses OpenGL to open a simple drawing window and show
a decoded WebP file. It's not yet integrated in the automake build system, but
you can try to manually compile it using the recommendations below.

Usage: vwebp in_file [options]

Decodes the WebP image file and visualize it using OpenGL
Options are:
  -version  .... print version number and exit
  -noicc ....... don't use the icc profile if present
  -nofancy ..... don't use the fancy YUV420 upscaler
  -nofilter .... disable in-loop filtering
  -dither <int>  dithering strength (0..100), default=50
  -noalphadither disable alpha plane dithering
  -mt .......... use multi-threading
  -info ........ print info
  -h     ....... this help message

Keyboard shortcuts:
  'c' ................ toggle use of color profile
  'i' ................ overlay file information
  'q' / 'Q' / ESC .... quit

Building:
---------

Prerequisites:
1) OpenGL & OpenGL Utility Toolkit (GLUT)
  Linux:
    $ sudo apt-get install freeglut3-dev mesa-common-dev
  Mac + XCode:
    - These libraries should be available in the OpenGL / GLUT frameworks.
  Windows:
    http://freeglut.sourceforge.net/index.php#download

2) (Optional) qcms (Quick Color Management System)
  i. Download qcms from Mozilla / Chromium:
    http://hg.mozilla.org/mozilla-central/file/0e7639e3bdfb/gfx/qcms
    http://src.chromium.org/viewvc/chrome/trunk/src/third_party/qcms
  ii. Build and archive the source files as libqcms.a / qcms.lib
  iii. Update makefile.unix / Makefile.vc
    a) Define WEBP_HAVE_QCMS
    b) Update include / library paths to reference the qcms directory.

Build using makefile.unix / Makefile.vc:
$ make -f makefile.unix examples/vwebp
> nmake /f Makefile.vc CFG=release-static \
    ../obj/x64/release-static/bin/vwebp.exe

Animated GIF conversion:
========================
Animated GIF files can be converted to WebP files with animation using the
gif2webp utility available under examples/. The files can then be viewed using
vwebp.

Usage:
 gif2webp [options] gif_file -o webp_file
Options:
  -h / -help  ............ this help
  -lossy ................. encode image using lossy compression
  -mixed ................. for each frame in the image, pick lossy
                           or lossless compression heuristically
  -q <float> ............. quality factor (0:small..100:big)
  -m <int> ............... compression method (0=fast, 6=slowest)
  -kmin <int> ............ min distance between key frames
  -kmax <int> ............ max distance between key frames
  -f <int> ............... filter strength (0=off..100)
  -metadata <string> ..... comma separated list of metadata to
                           copy from the input to the output if present
                           Valid values: all, none, icc, xmp (default)
  -mt .................... use multi-threading if available

  -version ............... print version number and exit
  -v ..................... verbose
  -quiet ................. don't print anything

Building:
---------
With the libgif development files installed, gif2webp can be built using
makefile.unix:
$ make -f makefile.unix examples/gif2webp



( run in 0.968 second using v1.01-cache-2.11-cpan-119454b85a5 )