Skip to content

M4.67–M4.69: TIFF, BMP and Targa export - #110

Merged
bflatastic merged 3 commits into
mainfrom
pr/m4-tiff-bmp-tga
Oct 5, 2026
Merged

bflatastic merged 3 commits into
mainfrom
pr/m4-tiff-bmp-tga

Conversation

@bflatastic

Copy link
Copy Markdown
Member

TIFF, BMP and Targa export, each with an options dialog.

M4.67: TIFF

  • New options: colorModel: rgb|cmyk|gray, lzw, byteOrder and embedIcc. The resolution is written into the file.
    • rgb keeps an alpha channel.
    • cmyk writes ink amounts.
    • gray is flattened on white.
  • LZW uses the weezl crate (MIT/Apache).
  • TIFF can now be written as well as read.
  • EPS previews now use this TIFF writer instead of their own copy.

M4.68: BMP

  • Depths of 1, 4, 8, 16, 24 or 32 bits. 4 and 8 bits use the existing palette code.
  • RLE, Windows or OS/2 layout, flipped rows, and RGB or grey.
  • Combinations the format can't hold are refused.

M4.69: Targa

  • 16, 24 or 32 bits per pixel, with 1-bit or 8-bit alpha.

Dialogs: each format has an options dialog (tiffOptions, bmpOptions, tgaOptions) built on the PNG Options rows.

Changed tests:

  • The writable-format lists.
  • Three MCP tests that used .bmp as the format that can't be written now use .dwg.

Checks

  • This PR is the 7th of 9 in a stack, merged in order on main at e2e36f2 (M4.76: EPS export #103).
    • Conflicts in shared files were merged keeping both sides: format tables, test modules, the dialog registry, docs/mcp.md and docs/control-protocol.md.
    • cargo fmt ran on every commit.
  • cargo xtask ci passes all 7 steps (fmt, clippy, tests, assets, brands, layers, wasm) on the top of the stack, with 2,769 tests.
    • Each branch also passed CI on its own before it was stacked, except PDF security: its final edits (removing the guard) were tested in the stack.
  • Nothing dropped: compared with main, the stack keeps every test (2556 → 2764 by name), every engine command (565 → 586), every UI command and menu entry, and every MCP tool. Changed tests are named above.
  • docs/mcp.md code fences are balanced.

🤖 Generated with Claude Code

bflatastic and others added 3 commits October 5, 2026 15:24
…rder and the profile

document.export {format: "tiff"} writes baseline TIFF through the raster
export path (resolution, background, anti-aliasing, artboard ranges):
colorModel rgb (transparency as unassociated alpha), cmyk (ink amounts,
CMYK colours keep their inks) or gray, lzw (weezl), byteOrder little (II)
or big (MM), embedIcc, and the resolution tags. Export As offers it with
the tiffOptions dialog; TIFF moves from read-only to read and write.

The TIFF writer is shared: EPS previews now use it (and its PackBits)
instead of their own copy, so eps depends on render (layers allow it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ped rows

document.export {format: "bmp"} writes BMP through the raster export path:
depth 1 (black and white), 4 or 8 (a palette by reduction and dither,
optionally RLE4/RLE8), 16 (5-5-5), 24 or 32 (with alpha, a version 4
header); colorModel rgb or gray; fileFormat windows or os2 (a core header);
flipRows writes top-down rows (a negative height). Impossible combinations
are refused as bad params. Export As offers it with the bmpOptions dialog,
which keeps its choices writable together; BMP moves from read-only to read
and write (tests that used .bmp as the unwritable format now use .dwg).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
document.export {format: "tga"} writes uncompressed true-colour Targa files
through the raster export path (resolution, background, anti-aliasing,
artboard ranges): depth 16 (5-5-5 with a one-bit alpha), 24 (flattened on
white) or 32 (8-bit alpha), rows bottom-up, with the version 2 footer.
Export As offers it with the tgaOptions dialog (Depth).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic merged commit df4b840 into main Oct 5, 2026
@bflatastic
bflatastic deleted the pr/m4-tiff-bmp-tga branch October 5, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant