From bac7ad1ec4d70597c87196cef7bb3b3efa989592 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 9 Apr 2026 23:07:00 +0000 Subject: [PATCH 1/3] docs: fix format count, missing formats, TIFF description, and orphaned sentence Agent-Logs-Url: https://github.com/cross-org/image/sessions/82db3afd-245a-4890-b8d3-71dca53c36f4 Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com> --- README.md | 7 ++-- docs/src/examples/decoding-encoding.md | 45 ++++++++++++++++++++++++++ docs/src/index.md | 7 ++-- 3 files changed, 51 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0b9cc00..a035fe9 100644 --- a/README.md +++ b/README.md @@ -199,8 +199,8 @@ const imageWithWarnings = await Image.decode(data, { ``` **Note:** When using `Image.decode()`, the library automatically tries runtime-optimized decoders - -## CMYK Color Space Support +(ImageDecoder API) first, falling back to the pure JS decoder with tolerant mode for maximum +compatibility. The library provides utilities for working with CMYK (Cyan, Magenta, Yellow, Key/Black) color space, commonly used in professional printing and color manipulation. @@ -378,9 +378,6 @@ const roundtrip = await Image.decode(parsed.bytes, "png"); console.log(roundtrip.width, roundtrip.height); ``` -(ImageDecoder API) first, falling back to the pure JS decoder with tolerant mode for maximum -compatibility. - ## Fault-Tolerant Decoding for Other Formats In addition to JPEG, @cross/image provides fault-tolerant decoding for several other formats that diff --git a/docs/src/examples/decoding-encoding.md b/docs/src/examples/decoding-encoding.md index 18bf2b8..52dedca 100644 --- a/docs/src/examples/decoding-encoding.md +++ b/docs/src/examples/decoding-encoding.md @@ -280,6 +280,51 @@ const pcx = await image.encode("pcx"); await Deno.writeFile("output.pcx", pcx); ``` +### QOI (Quite OK Image) + +Fast lossless format with simple encoding. + +```ts +import { Image } from "jsr:@cross/image"; + +const data = await Deno.readFile("input.png"); +const image = await Image.decode(data); + +// Encode as QOI +const qoi = await image.encode("qoi"); +await Deno.writeFile("output.qoi", qoi); +``` + +### PGM (Portable GrayMap) + +Netpbm grayscale format; RGB is converted to grayscale using luma weighting. + +```ts +import { Image } from "jsr:@cross/image"; + +const data = await Deno.readFile("input.png"); +const image = await Image.decode(data); + +// Encode as PGM (binary P5 format) +const pgm = await image.encode("pgm"); +await Deno.writeFile("output.pgm", pgm); +``` + +### PBM (Portable BitMap) + +Netpbm monochrome format; pixels at or above luma 128 become white. + +```ts +import { Image } from "jsr:@cross/image"; + +const data = await Deno.readFile("input.png"); +const image = await Image.decode(data); + +// Encode as PBM (binary P4 format) +const pbm = await image.encode("pbm"); +await Deno.writeFile("output.pbm", pbm); +``` + ## Format Conversion Examples ### PNG to JPEG diff --git a/docs/src/index.md b/docs/src/index.md index 93eeb5f..a1bc51b 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -136,12 +136,13 @@ await Image.decode(bytes, "png"); ## Supported Formats -@cross/image supports 15 image formats with varying levels of pure-JS implementation: +@cross/image supports 18 image formats with varying levels of pure-JS implementation: -- **PNG, APNG, BMP, ICO, GIF, DNG, PAM, PPM, PCX, ASCII** - Full pure-JS implementation +- **PNG, APNG, BMP, ICO, GIF, DNG, PAM, PPM, PGM, PBM, PCX, QOI, ASCII** - Full pure-JS + implementation - **JPEG** - Pure-JS baseline & progressive DCT - **WebP** - Pure-JS lossless, native API for lossy VP8 -- **TIFF** - Pure-JS uncompressed + LZW, native API for other compressions +- **TIFF** - Pure-JS uncompressed, LZW, PackBits & Deflate; native API for JPEG compression - **HEIC, AVIF** - Runtime-based implementation (requires ImageDecoder/OffscreenCanvas API) See the [Format Support](formats.md) page for detailed compatibility information. From b30e83f265fdf6c10cc9459c6ab4ee8a6ed900c6 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Fri, 10 Apr 2026 21:39:50 +0200 Subject: [PATCH 2/3] Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a035fe9..20067fb 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ const imageWithWarnings = await Image.decode(data, { (ImageDecoder API) first, falling back to the pure JS decoder with tolerant mode for maximum compatibility. +## CMYK Color Space Support The library provides utilities for working with CMYK (Cyan, Magenta, Yellow, Key/Black) color space, commonly used in professional printing and color manipulation. From 6c49422ded208b1072087439286c724f4562c0bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:17:08 +0000 Subject: [PATCH 3/3] docs: fix missing blank line after CMYK heading in README (deno fmt) Agent-Logs-Url: https://github.com/cross-org/image/sessions/6c6c0b24-7a1d-4e64-bbfd-da6dfb23c777 Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com> --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 20067fb..0679210 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,7 @@ const imageWithWarnings = await Image.decode(data, { compatibility. ## CMYK Color Space Support + The library provides utilities for working with CMYK (Cyan, Magenta, Yellow, Key/Black) color space, commonly used in professional printing and color manipulation.