GraphicsFormats Xojo plugin

RawWebPExporter Class

A class to Export RawBitmap to a WebP format. The result can be written to a File or string.

WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster.

WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index.

Lossless WebP supports transparency (also known as alpha channel) at a cost of just 22% additional bytes. For cases when lossy RGB compression is acceptable, lossy WebP also supports transparency, typically providing 3× smaller file sizes compared to PNG.

This class and this plugin is copyright Copyright (c) Einhugur Software.

This class uses libwebp which has the following license:

Copyright (c) 2010, Google Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.

* Neither the name of Google nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Object
   RawWebPExporter

class RawWebPExporter implements

IRawBitmapWriter

IRawBitmapWriterV2

Properties

EncodeLosslessIf set too true then the WebP image will be encoded in lossless format. If set to false the lossy format is used.
ErrorMessageError message for last error that occurred.
LastErrorReturns enum error code for last error that occurred.
QualitySets quality factor when using the lossy encoding.

Methods

FileExtensionsReturns array of file extensions which this image format can use.
GetLastErrorCodeSame as the LastError property but this one returns it as Integer to full-fill the standard interface.
InternetMediaTypesReturns array of internet media types which this image format can use.
SaveToFileSaves a bitmap to a WebP file using the quality and choice of lossy or non lossy that have been set on the class.
SaveToStringSaves a bitmap to WebP formatted string using the quality and choice of lossy or non lossy that have been set on the class.
UTIReturns UTI identifier for the file format of this class.
UTIConformsToReturns UTI conforms to identifier for the file format of this class.
UTIDescriptionReturns UTI description for the file format of this class.

Enumerations

ErrorValuesEnum representing error codes which this class can return.

Constants

Version = 7.5

Supported Platforms:

  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM

    Unsupported Platforms:

  • MacOS X Carbon