Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

WebP lossless (VP8L) image encoder

NotificationsYou must be signed in to change notification settings

honzasp/vp8l

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The program loads an image (in any of the widely supported formats such as JPEG,PNG or BMP) and encodes it in the WebP lossless format (VP8L codec). The programuses most of the features of the VP8L format to achieve better compression thanPNG and is not much worse than the officiallibwebp implementation. However,the program is quite slow compared to the heavily optimized image compressionlibraries currently in use, but this is mostly due to the focus on clarityrather than on performance.

The implemented VP8L features include:

  • entropy coding of image data using canonical Huffman codes
  • LZ77 backward references
  • local color cache references (currently disabled, as it does not improvecompression)
  • palettization, possibly using sub-byte packing
  • subtract-green color transform to crudely decorrelate color channels
  • spatially-varying prediction

The notable features that arenot implemented are:

  • spatially-varying Huffman codes
  • advanced cross-color transform

The encoded images are usually 65%--90% size of PNG and 110%--160% the size oflossless WebP images produced bylibwebp.

Usage

Compile all the C# files in theVP8L/ directory and add a reference toSystem.Drawing to get an executableVP8L.exe. AMakefile is attached thatinvokesmcs that will do the trick. The executable can be invoked with twocommand-line arguments, as

VP8L.exe [input] [output]

where[input] is the path to the input image and[output] is the name of theproduced.webp file. The default paths areinput.png andoutput.webp.

Test images

The distribution includes a small corpus of images intest/input, used to testthe program. The included scripttest.sh invokes the program and stores thegenerated images intest/output. It also converts the images into WebP usingcwebp, the tool shipped withlibwebp, and saves them totest/ref forcomparison. To check that the output images are valid, the script converts themback to PNG usingdwebp, which also serves as a check that the produced WebPimages are valid.

Note that the script expects to find thedwebp andcwebp binaries in thetest/ directory and executes the program usingmono VP8L.exe.

Source guide

TheMain is located inVP8L/VP8L.cs, other source files are mostly namedafter the mainclass they contain (Argb.cs,Image.cs, ...) or thestatic class that must be used to wrap functions (Transform.cs,ImageData.cs,...). Read the comments to gain basic understanding of the inner workings.

About

WebP lossless (VP8L) image encoder

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp