Skip to content

Rasterised layers in vector output, and EPS - #58

Merged
Jonathan-Schaefer-git merged 3 commits into
mainfrom
m11c/output
Nov 30, 2026
Merged

Jonathan-Schaefer-git merged 3 commits into
mainfrom
m11c/output

Conversation

@Jonathan-Schaefer-git

Copy link
Copy Markdown
Collaborator

Rasterised layers in vector output, and EPS: the Output minor. Stacked on #57: this branch starts from m11a/time, so until #57 merges the diff below shows #57's commits too. This PR's own changes are the last commits.

Everything is additive. api/*.fsi gains 30 lines and loses none, and no existing baseline moved.

What it adds

  • Chart.withRasterized dpi (Layer.Rasterize, C# .WithRasterized(300)). The compiled layer is wrapped in an Annotated node carrying a reserved Semantics.Data entry. The IR, the wire and every backend that ignores the mark are unchanged.
  • SkiaBackend.rasterizeMarked extent node (and rasterizeMarkedWith options). Each marked subtree is drawn by Skia at the box of the clip it stands in (the panel's plot), scaled by dpi/96, and put back as a Raster inside the same clip. A scene with no mark comes back as the same value. The Skia PDF writer runs it; an SVG or TikZ figure goes through it first, in .NET. Under Fable the layer stays vector, which the canvas log of the new golden shows.
  • EPS. Eps.ofPdf in Marey.Toolchain tries Ghostscript's eps2write first (gswin64c on Windows), then pdftops -eps. With neither on PATH the error names both, with how to install each. Also SkiaBackend.renderEps and renderEpsToFile, and C# EpsRenderer.Render. Marey.Backend.Skia now references Marey.Toolchain, which takes no dependencies.
  • Guide §6: Dense layers and EPS, including how transparency is flattened. Changelog [Unreleased], and docs/not-in-1.0.md's Output line.
  • Census. pdftops joins the suite's toolchain census, now 11 entries: it is the converter CI has, since CI installs poppler-utils but not Ghostscript.

Gates

Gate What Break Broken Holds
C1 P6 (10⁵ points, 300 dpi) as PDF: 1.1 MB, was 16.3 MB; text in embedded fonts (pdffonts: Inter, CID TrueType, embedded); one image and its soft mask. Its SVG through the pass: one <image>, no <circle>/<use>. An unmarked figure is the same value, so the same bytes ignore the mark both fail yes
C2 P4's schedule as EPS: %%BoundingBox: 0 0 480 300 (640 × 400 px), font programs embedded, through gs and through pdftops alone. With an empty PATH the error names gs and pdftops drop the probe fails yes

Baselines

One new figure, figure-rasterized. Its SVG goes through the pass, unantialiased at 48 dpi to keep the embedded image small. Its canvas log and wire golden are the vector scene, which is what Node draws. No TikZ baseline: a TikZ raster writes a PNG sidecar, and the repository keeps exactly two binary baselines. Under Node (TZ=Pacific/Auckland): 46/46 SVG, 47/47 canvas, 47/47 wire.

Not done here

An SVG of a rasterised layer is large: Marey's own PNG encoder writes stored (uncompressed) deflate blocks, so P6 at 300 dpi is 8.9 MB of SVG. The guide says so and suggests a lower resolution for SVG. Compressing that encoder is its own change.

ScaleKind.Time (instants in seconds since 1970, read in a zone), Logit and
Asinh; TimeZone and Time; TicksCalendar, MinorCalendar, FormatDate; the
time verbs in both modes and C#; calendar ticks and concise labels by
integer arithmetic; the kind check in agreeOn; the readout, Live's absolute
guard and a shot's context pin. Six goldens (SVG, TikZ, canvas, wire), the
lab-log example, guide sections, changelog. Node runs its goldens with
TZ=Pacific/Auckland.

M11a of m11-plan.md: D273-D280 as ruled 2026-11-23. Gates A1-A9 each
made to fail by its named break first (marey-notes m11-build/progress.md).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Layer.Rasterize and Chart.withRasterized mark a layer with a reserved
Semantics entry; SkiaBackend.rasterizeMarked draws each marked subtree as
one Raster in its clip, and the Skia PDF writer runs it. Eps.ofPdf in
Marey.Toolchain converts by Ghostscript, then pdftops, naming both when
neither is found; SkiaBackend.renderEps and renderEpsToFile, EpsRenderer
for C#. Golden figure-rasterized; guide section 6; changelog. pdftops
joins the suite's census.

M11c of m11-plan.md: D287 (a) and D288 as ruled 2026-11-23. Gates C1 and
C2 each made to fail by its named break first.

Co-Authored-By: Claude <noreply@anthropic.com>
@Jonathan-Schaefer-git
Jonathan-Schaefer-git merged commit 74ce84d into main Nov 30, 2026
8 checks passed
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