GraphicsFormats Xojo plugin

RawWebPExporter Class (console safe)

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

Aborted (console safe) Returns true if the export was aborted by progress handler.
EncodeLossless (console safe) If set too true then the WebP image will be encoded in lossless format. If set to false the lossy format is used.
ErrorMessage (console safe) Error message for last error that occurred.
LastError (console safe) Returns enum error code for last error that occurred.
ProgressHandler (console safe) If delegate is assigned to this property then the exporter will report progress to the delegate method and the export can also be canceled from the delegate.
Quality (console safe) Sets quality factor when using the lossy encoding.

Methods

FileExtensions (console safe) Returns array of file extensions which this image format can use.
GetLastErrorCode (console safe) Same as the LastError property but this one returns it as Integer to full-fill the standard interface.
InternetMediaTypes (console safe) Returns array of internet media types which this image format can use.
SaveToFile (console safe) Saves a bitmap to a WebP file using the quality and choice of lossy or non lossy that have been set on the class.
SaveToString (console safe) Saves a bitmap to WebP formatted string using the quality and choice of lossy or non lossy that have been set on the class.
UTI (console safe) Returns UTI identifier for the file format of this class.
UTIConformsTo (console safe) Returns UTI conforms to identifier for the file format of this class.
UTIDescription (console safe) Returns UTI description for the file format of this class.

Enumerations

ErrorValuesEnum representing error codes which this class can return.

Constants

Version = 12.0

Supported Platforms:

  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 32 bit
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM 32 bit
  • Linux ARM 64 bit
  • iOS