tinyimg 1.1.1
Lightweight image manipulation library for WebAssembly
Loading...
Searching...
No Matches
TinyEncodeOpts Struct Reference

Options an encoder honors. More...

#include <image.h>

Public Attributes

uint8_t quality
uint8_t lossless
uint8_t progressive
uint8_t strip_metadata
uint8_t effort
 How much computation the encoder may spend; a TinyEffort.
uint8_t compression
 How hard to compress a lossless stream; a TinyCompression.

Detailed Description

Options an encoder honors.

Member Data Documentation

◆ compression

uint8_t TinyEncodeOpts::compression

How hard to compress a lossless stream; a TinyCompression.

Zero is TINYIMG_COMPRESSION_AUTO. Read by PNG and by deflate-compressed TIFF; a format with no deflate stream ignores it.

◆ effort

uint8_t TinyEncodeOpts::effort

How much computation the encoder may spend; a TinyEffort.

Zero is TINYIMG_EFFORT_FANCY, so a zeroed structure asks for the work every caller got before this field existed.

Two encoders read it. WebP bounds its 4x4 prediction search to the four whole-block modes, which is 1.18x to 1.45x and can move the output either way in bytes. PNG compresses one candidate stream instead of two, which is 1.59x to 2.08x; on a photograph the stream it keeps is the one that would have won, so the output is byte-identical, and on flat artwork it costs 7% to 63% more bytes. Every other encoder ignores this and does the exact thing.

◆ lossless

uint8_t TinyEncodeOpts::lossless

Non-zero to use a format's lossless mode where it has one.

◆ progressive

uint8_t TinyEncodeOpts::progressive

Non-zero to write a progressive or interlaced stream.

◆ quality

uint8_t TinyEncodeOpts::quality

Quality for a lossy format, 0 to 100.

◆ strip_metadata

uint8_t TinyEncodeOpts::strip_metadata

Non-zero to drop EXIF and other metadata from the output.


The documentation for this struct was generated from the following file: