Skip to content

Define codec for LZW compression #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions codecs/lzw/README.md
Original file line number Diff line number Diff line change
@@ -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)
16 changes: 16 additions & 0 deletions codecs/lzw/schema.json
Original file line number Diff line number Diff line change
@@ -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" }
]
}