@8thwall/image-target-cli

中文文档
1.0.0发布于 2026/03/04MITES Module近 30 天下载 6301

Generate 8th Wall Image Target Metadata

原始使用文档

Image Target CLI

This CLI tool allows the creation of image targets in the format supported by the Offline Engine.

Usage

npx @8thwall/image-target-cli@latest

You will be prompted to enter an image path, select crop, and choose a folder/image target name. You can either use a default centered crop, or choose your crop dimensions according to this diagram:

Diagram showing an original image dimension of 2000x2000, then a crop being applied by offsetting the top left corner by the top and left parameters, and reducing the width and height of the crop using width and height parameters

If you choose a cylindrical geometry, you will also be prompted for the cylinder circumference and target width. See the diagram below for a visualization. The choice of units (mm vs inches) will not affect tracking behavior, so the measurements can also be scale-free.

3D Visualization showing two views of a cylinder with a label wrapped around the side. One view shows the entire top circle of the cylinder highlighted. The other view shows the top edge of the label highlighted, which is about one third of the full circumference

For conical images, wider top and wider bottom shapes are both supported. The below image shows the input format, with the label curving around the shape of a large circle. For wider bottom images, the arc of the label should curve the opposite direction. You will be prompted for the outer radius and inner radius of the label's curve. You'll also input the angle of the cone covered by label. If you choose to customize the crop, you'll be cropping against the flattened geometry image, as shown below.

Diagram showing a conical image target as it is processed. Initially the label is aligned to a section of a ring, with rounded top and bottom edges. The same label is shown flattened to a rectangle, with right angled sides. The flattened label displays a crop being applied by offsetting the top left corner by the top and left parameters, and reducing the width and height of the crop using width and height parameters.

On generation, the following will be outputted:

  • Metadata within a json file
  • Original image
  • Geometry image (for conical)
  • Cropped image
  • Thumbnail image (263x350)
  • Luminance image (grayscale, 480x640)

Generated image targets can be loaded into the engine by adding this code to your project:

const onxrloaded = () => {
  XR8.XrController.configure({
    imageTargetData: [
      require('../image-targets/target1.json'),
      require('../image-targets/target2.json'),
    ],
  })
}
window.XR8 ? onxrloaded() : window.addEventListener('xrloaded', onxrloaded)

The imagePath field of the json data will tell the engine where to load the tracked image, which will have its features extracted and compared to the camera feed.

版本与发布记录

@8thwall/image-target-cli 共发布 5 个版本,首次发布于 2026/03/04;过去 12 个月发布了 5 个版本。

版本发布日期距今
1.0.0latest2026/03/048 个月前
1.0.0-alpha.3alpha2026/03/048 个月前
1.0.0-alpha.22026/03/048 个月前
1.0.0-alpha.12026/03/048 个月前
1.0.0-alpha.02026/03/048 个月前

关于 @8thwall/image-target-cli 的常见问题

@8thwall/image-target-cli 是什么?

Generate 8th Wall Image Target Metadata

如何安装 @8thwall/image-target-cli?

在项目目录运行 npm install @8thwall/image-target-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 image-target-cli,可以用 npx image-target-cli 直接运行。

@8thwall/image-target-cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/8thwall__image-target-cli 是否存在。

@8thwall/image-target-cli 支持 ESM 还是 CommonJS?

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

@8thwall/image-target-cli 可以商用吗?

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

@8thwall/image-target-cli 的下载量有多少?

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

@8thwall/image-target-cli 还在维护吗?

最新版本 1.0.0 发布于 2026/03/04(8 个月前);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/03/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。