How qurle/compare works
Difference for Figma is a Figma plugin that compares two selected frames pixel by pixel and creates a comparison frame. The main flow validates and orders the selection, exports PNG snapshots, delegates image processing to a hidden UI iframe, then creates and selects a layered result and reports changed pixels. Settings and small shared utilities support that flow. The README describes the iframe’s decoding, diffing and encoding; its implementation was not excerpted, so details of that stage are limited to the documentation.
Main entry points: code.ts Selection and export · index.astro PNG diff worker · misc.ts Shared utilities · config.ts Comparison settings
Components 9
Plugin workflow
- Selection and export
src/code.ts - Figma document
- Comparison frame
src/code.ts - Result summary
src/code.ts
Image processing
- PNG diff worker
src/pages/index.astro
Shared support
- Comparison settings
src/config.ts - Shared utilities
src/helpers/misc.ts - Notification helpers
src/helpers/notifications.ts
Other components
- Plugin user
Connections 9
- Plugin user → Selection and export: runs plugin
readme.md - Selection and export → Comparison settings: reads settings
src/code.ts - Selection and export → Figma document: exports snapshots
src/code.ts - Selection and export → PNG diff worker: sends PNGs
src/code.ts - PNG diff worker → Selection and export: returns diff
readme.md - Selection and export → Comparison frame: creates result
src/code.ts - Selection and export → Result summary: formats summary
src/code.ts - Selection and export → Shared utilities: logs errors
src/code.ts - Shared utilities → Comparison settings: reads logging flag
src/helpers/misc.ts