Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ On macOS, Flash Mask outputs JSON 1.1 with an instruction for the whole image an

- Paste a screenshot directly from the clipboard.
- Add one instruction for the whole image and optional notes for individual regions.
- Use the interface in seven languages: English, Simplified Chinese, Traditional Chinese, Japanese, German, French, and Spanish.
- Use a dedicated settings window to switch language, check for updates, and open the website, help, GitHub source, or support page.

Instead of wrestling with lasso tools, fill layers, and manual exports in complex image editors, Flash Mask converts your selections into agent-ready coordinates in seconds:
Expand Down Expand Up @@ -113,14 +114,14 @@ Strict JSON 1.0 consumers must upgrade their validator before accepting JSON 1.1
- **Dual Coordinate Systems**: Generates both absolute pixel coordinates and resolution-independent normalized coordinates to support varied agent and model schemas.
- **Original Resolution Fidelity**: Black-and-white PNG masks match source image dimensions 1:1, rendered with pure white selections, pure black backgrounds, and crisp, unfeathered edges.
- **Direct Local File Paths**: The macOS app outputs verified absolute file paths in JSON so local automation scripts and agents can locate files instantly.
- **Bilingual Interface**: Seamlessly switch between full English and Chinese interfaces with one click.
- **Seven Interface Languages**: English, Simplified Chinese, Traditional Chinese, Japanese, German, French, and Spanish. The app follows your system language by default; switch anytime from the language menu in the top bar or in Settings without losing your current image, regions, or notes.
- **Privacy & Offline First**: Runs 100% locally with no sign-in required, zero ads, and no tracking or analytics SDKs.

## Getting Flash Mask

- **Mac App Store**: Get the official pre-built app on the [Mac App Store](https://apps.apple.com/us/app/flash-mask/id6803817818?mt=12). A one-time purchase with lifetime access—no subscriptions and no in-app purchases.
- **Official Website**: Visit [flashmask.net](https://flashmask.net/) for product updates and details.
- **Source Releases**: Download source code archives from [GitHub Releases](https://github.com/sudoHG/FlashMask/releases/tag/v1.0.0). *(Note: Official binary builds are distributed exclusively through the Mac App Store; GitHub Releases does not attach pre-built binaries).*
- **Source Releases**: Download source code archives from [GitHub Releases](https://github.com/sudoHG/FlashMask/releases). *(Note: Official binary builds are distributed exclusively through the Mac App Store; GitHub Releases does not attach pre-built binaries).*

## Open Source Scope

Expand Down Expand Up @@ -170,10 +171,10 @@ Alternatively, use the included `build.sh` script (run `./build.sh --help` for d

```sh
./build.sh
./build.sh --version 1.3 --build-number 8 --dmg
./build.sh --version 1.3.1 --build-number 9 --dmg
```

The script defaults to version `1.2` and build `7`; `--version` and `--build-number` override those values. It checks the built app's version, minimum macOS version, and both architecture slices. `--dmg` packages that unsigned app for local testing; the resulting DMG is not suitable for Gatekeeper distribution.
The script defaults to version `1.3` and build `8`; `--version` and `--build-number` override those values. It checks the built app's version, minimum macOS version, and both architecture slices. `--dmg` packages that unsigned app for local testing; the resulting DMG is not suitable for Gatekeeper distribution.

For distribution outside the Mac App Store, sign the app with your own **Developer ID Application** identity and a secure timestamp, verify its code signature, submit it for notarization, and staple and validate the accepted ticket. Then package that exact app with:

Expand All @@ -198,13 +199,18 @@ The test suite covers:
- Polygon geometry calculations and lasso vertex simplification (smoothing and redundancy removal)
- 1:1 black-and-white PNG mask pixel rasterization accuracy
- Performance boundaries and vertex count limit safeguards
- Localization resources: identical keys, placeholders, and paired bundle resources across all seven languages

On macOS, `npm test` also compiles and runs the native Swift tests (localization resources and Settings window placement), which briefly open test windows. Run the native interface tests separately with `node --test tests/mac-localization-ui.js`. CI runs the core tests on Linux and the native and interface tests on Apple Silicon macOS 15, Intel, and macOS 14; see the [contribution guide](贡献指南.md).

## Directory Structure

| Path | Description |
|---|---|
| `index.html` | Embedded editor interface, canvas interactions, and UI state machine |
| `src/` | Coordinate contract parsing, mask rasterization, and selection vertex cleaning algorithms |
| `src/localizations/` | Interface text for all seven languages, one JSON file per language |
| `scripts/` | Build-time script that validates and packages the paired localization resources |
| `schemas/` | Official JSON Schema definitions for the Flash Mask 1.0 and 1.1 Coordinate Contracts |
| `macos/` | Native AppKit / WKWebView host wrapper, security-scoped file access, and Xcode project |
| `tests/` | Unit tests, contract validation suites, and test fixtures |
Expand Down
14 changes: 10 additions & 4 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Flash Mask 是一款专为 AI 图像编辑与视觉工作流打造的轻量 macO

- 直接从剪贴板粘贴截图。
- 为整张图片填写说明,也可以为各个区域添加说明。
- 界面支持七种语言:英文、简体中文、繁体中文、日语、德语、法语和西班牙语。
- 在独立设置窗口中切换语言、检查更新,并打开官网、帮助、GitHub 源码或支持页。

Flash Mask 省去了在大型图像软件中繁琐套索、填充和导出图层的步骤,在几秒内将你的圈选转化为 Agent 可直接解析的坐标数据:
Expand Down Expand Up @@ -113,14 +114,14 @@ Flash Mask 输出带版本标识、自解释的标准 JSON 数据,内置像素
- **双坐标系输出**:兼具绝对像素坐标与分辨率无关的归一化坐标,适配不同 Agent 与模型接口。
- **原图尺寸保真**:导出的黑白 PNG 蒙版严格与原图宽高 1:1 对应,选区纯白、背景纯黑、无羽化。
- **本地路径直达**:Mac 端复制的 JSON 包含验证后的本地文件绝对路径,方便本地自动化脚本与 Agent 直接定位文件。
- **中英双语界面**:提供完整中文与英文界面,一键无缝切换。
- **七种界面语言**:英文、简体中文、繁体中文、日语、德语、法语和西班牙语。默认跟随系统语言,也可随时从顶栏语言菜单或设置中切换,当前图片、选区和说明不受影响。
- **隐私与离线优先**:纯本地运行,无需账号登录,无任何广告或分析追踪 SDK。

## 获取 Flash Mask

- **Mac App Store**:在 [Mac App Store](https://apps.apple.com/cn/app/flash-mask/id6803817818?mt=12) 获取官方预编译版本。一次性买断,终身可用,无任何订阅或应用内购买。
- **官方网站**:访问 [flashmask.net](https://flashmask.net/) 了解产品动态与体验说明。
- **源码 Release**:在 [GitHub Releases](https://github.com/sudoHG/FlashMask/releases/tag/v1.0.0) 获取源码归档。(注:官方二进制安装包统一通过 Mac App Store 分发,GitHub Releases 不附加预编译安装包)。
- **源码 Release**:在 [GitHub Releases](https://github.com/sudoHG/FlashMask/releases) 获取源码归档。(注:官方二进制安装包统一通过 Mac App Store 分发,GitHub Releases 不附加预编译安装包)。

## 本仓库开源范围

Expand Down Expand Up @@ -170,10 +171,10 @@ xcodebuild \

```sh
./build.sh
./build.sh --version 1.3 --build-number 8 --dmg
./build.sh --version 1.3.1 --build-number 9 --dmg
```

脚本默认版本为 `1.2`、构建号为 `7`;可用 `--version` 和 `--build-number` 覆盖。它会检查构建产物的版本、最低 macOS 版本和两种架构。`--dmg` 会把无签名 App 打包为本地测试 DMG,该 DMG 不适合通过 Gatekeeper 分发。
脚本默认版本为 `1.3`、构建号为 `8`;可用 `--version` 和 `--build-number` 覆盖。它会检查构建产物的版本、最低 macOS 版本和两种架构。`--dmg` 会把无签名 App 打包为本地测试 DMG,该 DMG 不适合通过 Gatekeeper 分发。

若要在 Mac App Store 之外分发,请先使用自己的 **Developer ID Application** 身份和安全时间戳签名,验证代码签名后提交公证;Apple 接受后钉附并验证公证票据。随后用以下命令打包同一个 App:

Expand All @@ -198,13 +199,18 @@ npm test
- 多边形几何计算与套索选区顶点清洗(平滑与去冗余)
- 1:1 黑白 PNG 蒙版栅格化像素渲染准确性
- 性能边界与顶点数量限制保护
- 本地化资源:七种语言的键、占位符和成对的 Bundle 资源保持一致

在 macOS 上运行 `npm test` 还会编译并运行原生 Swift 测试(本地化资源与设置窗口位置),期间会短暂打开测试窗口。原生界面测试需单独运行 `node --test tests/mac-localization-ui.js`。CI 在 Linux 上运行核心测试,并在 Apple Silicon macOS 15、Intel 和 macOS 14 上运行原生测试与界面测试,详见[贡献指南](贡献指南.md)。

## 目录结构

| 路径 | 说明 |
|---|---|
| `index.html` | Mac App 内嵌编辑界面、画布交互控制与 UI 状态机 |
| `src/` | 坐标合同协议解析、蒙版栅格化与套索选区清洗算法 |
| `src/localizations/` | 七种语言的界面文案,每种语言一个 JSON 文件 |
| `scripts/` | 构建时校验并打包成对本地化资源的脚本 |
| `schemas/` | Flash Mask 1.0 与 1.1 坐标数据合同的官方 JSON Schema 定义 |
| `macos/` | AppKit / WKWebView 原生宿主包装、安全作用域文件访问与 Xcode 工程 |
| `tests/` | 核心单元测试、契约测试与验证用例 |
Expand Down
Loading