# @fest-lib/image 中文文档

规范地址：https://npmcn.com/package/%40fest-lib/image/

版本：0\.1\.50
npm 元数据更新时间：2026-11-03T05:23:55.370Z
中文译文更新时间：2026-11-14T15:03:57.876Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40fest-lib/image
原文对照：https://npmcn.com/package/%40fest-lib/image/?lang=original
项目主页：https://github.com/fest-live/image.ts#readme
源码仓库：https://github.com/fest-live/image.ts

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：457 kB，4 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=20
- 运行依赖：6 个
- peer 依赖：@fest-lib/dom \>=0\.1\.0，@fest-lib/core \>=0\.1\.0，@fest-lib/lure \>=0\.1\.0，@fest-lib/object \>=0\.1\.0，@fest-lib/style-lib \>=0\.1\.0
- 首次发布：2026-08-08T01:31:16.736Z
- 最新版本发布：2026-11-03T05:23:55.117Z
- 近 30 天下载量：2224（2026-10-15 至 2026-11-13，npm 官方下载统计）
- 已发布版本数：44（近 12 个月 44 个）

## 中文简介

fest-lib 图像: 东方意识壁纸画布和 K- Means 主题种子

## 安装

```sh
npm install @fest-lib/image
```

也可以使用：`pnpm add @fest-lib/image`、`yarn add @fest-lib/image`、`bun add @fest-lib/image`

## README

**@fest-lib/图像**  
定向- 有意识的壁布 + Veela 的 K- Means 种子(`--color-primary` /中学/大学).

[![npm](https://img.shields.io/npm/v/@fest-lib/image?style=flat-square)](https://www.npmjs.com/package/@fest-lib/image) [![MIT](https://img.shields.io/npm/l/@fest-lib/image?style=flat-square)](https://npmcn.com/package/%40fest-lib/image/LICENSE) [![stars](https://img.shields.io/github/stars/fest-live/image.ts?style=flat-square)](https://github.com/fest-live/image.ts)

检查上一个壁纸 URL 和种子颜色, 以便重新装入可以跳过重分组 。 绘图目标 : `[data-app-layer="canvas"] canvas[is="ui-canvas"]`。 。 。 .

```text
core · dom · object · lure
 └── fest/image       ← you are here
      └── shell wallpaper · Material You seed
```

## 安装

```bash
npm install @fest-lib/core @fest-lib/dom @fest-lib/object @fest-lib/lure @fest-lib/image
```

端点 : `core`, (中文(简体) ), `dom`, (中文(简体) ), `object`, (中文(简体) ), `lure`用户 `culori`。 。 。 .

```ts
import {
    setAppWallpaper,
    setAppWallpaperFromBlob,
    applyThemeFromWallpaper,
    syncAppWallpaperOrient
} from "@fest-lib/image";

setAppWallpaper("/wallpapers/desk.jpg");
await applyThemeFromWallpaper("/wallpapers/desk.jpg");
syncAppWallpaperOrient();

await setAppWallpaperFromBlob(file); // Blob | File
```

`setAppWallpaper(url)` 是在呼叫站点同步(在背景中运行的持久性+主题). `applyThemeFromWallpaper(url, { force: true })` 即使 URL 与缓存匹配,仍会重新分组.

## 版式

| 路径 | 作用 |
| --- | --- |
| `src/engine/KMean.ts` | 主要颜色 |
| `src/engine/WallpaperTheme.ts` | 种子 = 主题主机 |
| `src/canvas/Canvas.ts` | 覆盖/正方涂料 |
| `src/canvas/Canvas-2.ts` | 应用程序壁纸层 + IDB |

不要重写 K- Means 或 Canvas-2 彩绘路径, 除非这就是任务所在 .

## 工作空间

```bash
cd modules/projects/image.ts
npm run dev
npm run build
npm run publish
```

许可证 : [麻省理工学院](https://npmcn.com/package/%40fest-lib/image/LICENSE)。 。 。 .

## 常见问题

### @fest-lib/image 是什么？

fest-lib 图像: 东方意识壁纸画布和 K- Means 主题种子

### 如何安装 @fest-lib/image？

在项目目录运行 npm install @fest-lib/image，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@fest-lib/dom（\>=0\.1\.0）、@fest-lib/core（\>=0\.1\.0）、@fest-lib/lure（\>=0\.1\.0）、@fest-lib/object（\>=0\.1\.0）、@fest-lib/style-lib（\>=0\.1\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @fest-lib/image 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/fest-lib\_\_image 是否存在。

### @fest-lib/image 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @fest-lib/image 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=20。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @fest-lib/image 可以商用吗？

@fest-lib/image 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @fest-lib/image 的下载量有多少？

根据 npm 官方下载统计，@fest-lib/image 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,224 次，日均约 74 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @fest-lib/image 还在维护吗？

最新版本 0\.1\.50 发布于 2026/11/03（11 天前）；至今共发布 44 个版本，其中过去 12 个月发布了 44 个；首次发布于 2026/08/08。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

