From dce2a1a0282c203ad391b23d9a11a47736cade07 Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Fri, 30 May 2025 15:49:12 -0400 Subject: [PATCH] Define codec for LZW compression --- codecs/lzw/README.md | 37 +++++++++++++++++++++++++++++++++++++ codecs/lzw/schema.json | 16 ++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 codecs/lzw/README.md create mode 100644 codecs/lzw/schema.json diff --git a/codecs/lzw/README.md b/codecs/lzw/README.md new file mode 100644 index 0000000..8915a1e --- /dev/null +++ b/codecs/lzw/README.md @@ -0,0 +1,37 @@ +# lzw codec + +Defines a `bytes -> bytes` codec that applies [LZW (Lempel-Ziv-Welch) compression](https://ieeexplore.ieee.org/document/1659158). + +## Codec name + +The value of the `name` member in the codec object MUST be `lzw`. + +## Configuration parameters + +None + +## Example + +For example, the array metadata below specifies that the array is compressed using the LZW method: + +```json +{ + "codecs": [{ + "name": "lzw" + }] +} +``` + +## Format and algorithm + +This is a `bytes -> bytes` codec. + +Encoding and decoding is performed using the algorithm defined in [Welch, "A Technique for High-Performance Data Compression," in Computer, vol. 17, no. 6, pp. 8-19, June 1984, doi: 10.1109/MC.1984.1659158](https://ieeexplore.ieee.org/document/1659158) + +## Change log + +No changes yet. + +## Current maintainers + +* [@cgohlke](https://github.com/cgohlke) in [imagecodecs](https://github.com/cgohlke/imagecodecs) diff --git a/codecs/lzw/schema.json b/codecs/lzw/schema.json new file mode 100644 index 0000000..f273c28 --- /dev/null +++ b/codecs/lzw/schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "type": "object", + "properties": { + "name": { + "const": "lzw" + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "const": "lzw" } + ] +}