Preface

One of the core design principles of DeepSeek Harness (DSH) is “everything is a plugin.” When building visual capabilities, if a large image is directly input to a vision model, the model usually downscales the entire image to an equivalent resolution of about 800×800 pixels, causing local details to be lost.

The meng-114/dsh-image-tiler plugin was created to solve this problem. It splits a large image into coordinate-labeled tiles and retains a global overview image. This preserves the details required by the vision model while allowing quick localization of target regions through the overview image.

Core Features

The plugin provides a complete workflow, mainly including two tools and a set of auxiliary features.

Tiling Tool: tile_image

Call tile_image to perform tiling. The tool splits the original image according to configuration parameters and generates corresponding output files.

The parameters include:
* file_path: input image path.
* tile_size: side length of each tile, default 800 pixels.
* overlap: overlap area between tiles, default 40 pixels.
* output_dir: output directory, default tiles.
* format: output format (such as png, jpeg, webp).
* label: label.
* overview_size: side length of the overview image.
* max_tiles: maximum number of tiles, default 64.

Tile Reading Tool: read_tiles

read_tiles is responsible for reading tiles and supports multiple reading strategies:
* Region-based tile selection: supports center, left, right, top, bottom, full, or explicit coordinates (such as r1c2).
* Semantic localization: use the target parameter to directly describe the target (such as “the login button”), the plugin calls a vision model to locate a target box on the overview image, and returns tiles covering that region.
* Workbench selection: when called without parameters, the plugin reads the tiles checked by the user in the visual workbench.

Visual Workbench and Drag-and-Drop Tiling

  • Visual tiling workbench: after the model calls tile_image, the tool card becomes an interactive interface. You can drag a slider to preview the grid, click “Tile” to generate a thumbnail grid, and manually check the tiles that need to be read.
  • Drag-and-drop tiling: supports dragging an image directly into the DSH Web interface. The plugin automatically stores the image in the workspace’s .dsh-imgtiler/ directory and completes tiling.

Installation and Compatibility

The installation command is as follows:

dsh plugin add @mengli114/dsh-image-tiler

The plugin requires a specific DSH version and only supports versions in the DSH 0.1.7 line or higher (>=0.1.7-rc.1). Older versions do not support the card configuration feature.

Typical Usage

1. Image Tiling

First call tile_image to split a large image:

tile_image({
  file_path: "large.png",
  tile_size: 800,
  overlap: 40,
  format: "png"
})

2. Reading Tiles

  • Read by coordinates:
    read_tiles({
      // 读取第 1 行第 2 列及周围区域
      region: "r1c2"
    })
  • Read by semantic localization:
    read_tiles({
      target: "the login button"
    })
The model automatically locates "the login button" on the overview image and returns tiles covering that region.

Notes

  • Path security: the plugin strictly restricts input and output paths; both must be inside the current session’s workspace (session.header.cwd). Do not use absolute paths or paths outside the workspace.
  • Input formats: supports PNG, JPEG, GIF, WebP, AVIF, HEIF, TIFF. Note: GIF files are processed using only the first frame.
  • Tile count: a single call supports up to 600 tiles (the tool defaults to 64 tiles and can be increased via the max_tiles parameter).
  • Priority rules:
    • When target and explicit tiles parameters are both provided, the explicit tiles parameter takes precedence.
    • When target and workbench selection are both present, target takes precedence.

Summary

meng-114/dsh-image-tiler is a comprehensive image processing tool. Through tiling and the overview image mechanism, it helps vision models preserve details while reducing token consumption. Combined with the visual workbench and semantic localization features, it can significantly improve the accuracy and efficiency of complex image tasks.