YAPF/extensions/figma
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz d7f494a0c9 Language bindings, KDE thumbnails, yapf compare, in-memory encoding
- yapf_encode() / yapf_free_buffer(): encode to memory; yapf_save uses it
- yapf.c also compiles as C++
- `yapf compare`: size and decode speed of the original format vs YAPF,
  with a lossless check
- bindings with tested examples: C++ (header-only), C# (P/Invoke),
  Rust (crate, builds the C code), Go (cgo), Java (FFM API, Java 22+),
  Zig (@cImport), LuaJIT (FFI), TypeScript types for the JS port;
  Python now encodes in memory
- docs/LANGUAGES.md and examples/ with measured results
- KDE Dolphin thumbnail plugin (KF6, CMake)
- README: honest status for Photoshop / VS Code / Figma (not run in the
  apps yet) and macOS (cross-compiled only), platform table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:39:56 +02:00
..
src YAPF v1: fast byte-aligned format, SIMD, tools and plugins 2026-10-03 14:17:59 +02:00
build.js YAPF v1: fast byte-aligned format, SIMD, tools and plugins 2026-10-03 14:17:59 +02:00
code.js YAPF v1: fast byte-aligned format, SIMD, tools and plugins 2026-10-03 14:17:59 +02:00
manifest.json YAPF v1: fast byte-aligned format, SIMD, tools and plugins 2026-10-03 14:17:59 +02:00
README.md Language bindings, KDE thumbnails, yapf compare, in-memory encoding 2026-10-03 14:39:56 +02:00
ui.html YAPF v1: fast byte-aligned format, SIMD, tools and plugins 2026-10-03 14:17:59 +02:00

YAPF for Figma

  • Plugins → YAPF Image Format → Import YAPF image… — choose or drop .yapf files; each becomes a rectangle filled with the image.
  • Plugins → YAPF Image Format → Export selection as YAPF… — every selected layer is exported at 1×, 2× or 4× and downloaded as .yapf.

Both directions are pixel-exact: the plugin carries its own small PNG encoder/decoder instead of going through a canvas, which would alter semi-transparent pixels.

Install (development plugin)

  1. Use the Figma desktop app.
  2. Plugins → Development → Import plugin from manifest… and choose extensions/figma/manifest.json (or the one inside yapf-figma.zip from the Releases).
  3. Run it from Plugins → Development → YAPF Image Format.

To publish it to the Figma Community, use Publish in the same menu; Figma then assigns the plugin its real id.

Build

ui.html is generated: it inlines bindings/js/yapf.js and src/png.js into src/ui.src.html, because Figma loads the UI as a single file.

node build.js

Figma limits images to 4096 × 4096; larger .yapf files report an error.

Status

The plugin UI was tested in a browser engine (headless Chromium) with a simulated Figma main thread: import hands Figma a pixel-exact PNG, and export downloads a pixel-exact .yapf. code.js is syntax-checked. It has not yet been run inside Figma itself.