Preface¶
In DeepSeek Harness (DSH), handling images with a pure text model typically involves manual OCR or switching to a multimodal model. The former is cumbersome and produces fragmented evidence, while the latter relies on external vision APIs, making cost and privacy boundaries difficult to control.
picturereader is a DSH plugin developed by maintainer jing-hy (approximately 33 stars on GitHub, categorized as model inference). It transforms tasks like “viewing images / reading documents / editing images” into structured evidence consumable by pure text models: local pixel scanning, OCR, optional external VLM, and a visual twin adapter that allows text models to display native thumbnails within DSH. The current version is v3.2.0, licensed under MIT.
What This Is¶
In one sentence: A pixel-level image reading plugin for pure text models, running entirely locally by default, with optional PaddleOCR and external vision API support.
It primarily addresses three things:
- Translating image content into structured textual evidence (pixel analysis + OCR + optional VLM semantics), accompanied by an
image-readingmethodology skill. - Through the visual twin adapter, generating “(Visual)” variants for selected text models, unlocking native thumbnails and image block pasting in DSH, while intercepting image blocks into text paths to avoid
UNSUPPORTED_CONTENTerrors. - Providing a local image editing tool
image_edit(v3.2.0), performing resizing, watermarking, compositing, etc., purely on CPU without images leaving the local machine.
Version compatibility (from README): Specifically adapted for dsh 0.1.1-rc.2 and dsheac 5.1.0; also compatible with DeepSeek Harness EAC 4.2.0 and @deepseek-ai/dsh-client-ui-workspace rc.7.
Core Features¶
Visual Twin Adapter¶
Performs a Proxy in-place wrap on the provider of the selected model: declares inputModalities: ['text','image'] in listModels / resolveModel, with a “(Visual)” suffix added to the name. DSH then recognizes the model as supporting images, unlocking native thumbnails, image blocks entering the session, and paste access.
stream interception captures image blocks in requests, exports them to ~/.dsh/picturereader-vision/images/, and replaces them with text paths and local tool guidance before forwarding to the original adapter. The downstream receives pure text, avoiding UNSUPPORTED_CONTENT. Starting from v3.1.0, it also intercepts image blocks returned by the built-in read_image tool, similarly degrading them to text guidance.
Three-Mode Routing¶
Routing logic is centralized in routing.js and runtime.js, shared by various tools, visual twin stream, and vision_analyze:
| Mode | Default Pixel Scanning | Default OCR | Default External VLM | Characteristics |
|---|---|---|---|---|
| Privacy | Yes | Yes | No (hard block) | Image bytes never leave the local machine; API calls are blocked even if configured |
| Smart (default) | Yes | As needed | Worth calling | Local image viewing first, OCR for text, external VLM only for complex content |
| Strict | Yes | Yes | Yes | Multi-source evidence cross-validation, reliability first |
Local Toolchain¶
| Tool | Function |
|---|---|
image_scan |
Color grid, color block regions, texture and structure analysis; supports focus / region targeted zoom |
image_ocr |
Three engines: windows (built-in), paddle (optional), rapid (optional); automatic fallback on failure |
image_sample |
N×N pixel sampling for material and texture assessment |
image_crop |
Crop by region and export as PNG |
image_palette |
Primary color extraction (hex, name, proportion) and hue families |
image_compare |
Pixel comparison between two images or regions, with optional difference visualization |
image_batch |
Batch scanning, type determination, and suggestions for further analysis |
vision_analyze |
Unified entry point: combines pixel scanning, OCR, and optional VLM according to mode |
document_to_image |
Converts pdf / docx / doc / xlsx / xls / pptx / ppt to PNG page by page (requires LibreOffice + PyMuPDF) |
image_edit |
Local image editing: 22 pure CPU actions (Pillow + OpenCV, optional rembg / rawpy / realesrgan) |
External VLM Bridge (Optional)¶
After configuring an OpenAI-compatible endpoint (LM Studio, llama-server, cloud gateway, etc.), the model can decide whether to call vision_analyze(include_vlm=true) in Smart or Strict mode. In Privacy mode, the host side forcibly disables this, and images are never sent externally. The external API enhances capabilities but is not a required dependency.
Settings Card¶
The web settings page registers an “Image Reading” card: usage mode, external vision API, visual bridge model multi-select, OCR engine, and advanced parameters. Changes are written to ~/.dsh/settings.yaml and take effect immediately; changes to visual bridge model selection require restarting DSH.
Installation and Enabling¶
The following commands come from the plugin README’s quick start section. The SkillHub community directory (https://www.skillhub.cn/plugins/jing-hy/picturereader) includes this plugin, with installation methods consistent with the README.
- Install the plugin:
dsh plugin --profile web add picturereader
dsh plugin --profile headless add picturereader
For source installation, run dsh plugin --profile web add . in the plugin directory.
- (Recommended) Copy the image reading methodology skill to the DSH skills directory:
cp skills/image-reading.md ~/.dsh/skills/
- Install optional dependencies as needed:
node scripts/setup-ocr.mjs # PaddleOCR
node scripts/setup-rapid.mjs # RapidOCR
node scripts/setup-doc-venv.mjs # Document to image (requires LibreOffice installed)
node scripts/setup-image-venv.mjs # image_edit core dependencies
node scripts/setup-image-venv.mjs --full # Additionally includes rembg, rawpy
After restarting DSH Desktop, all tools appear in the model tool list, and the “Image Reading” card appears in the settings page.
Enable visual twin:
- In the settings page’s “Image Reading” card, select the target text model and save, then restart DSH.
- In the model selector, choose the “(Visual)” variant of the corresponding model.
- Paste or drag in an image to see the native thumbnail, and the image block is automatically analyzed into textual evidence.
Typical Usage¶
Read a local image:
Use image_scan to examine this image at <path>, focusing on parts of interest
For complex scenarios, follow up with vision_analyze; for text-heavy content, start with image_ocr; for multiple images, use image_batch; for Office / PDF documents, first convert to images page by page with document_to_image before analysis.
image_edit examples:
Use image_edit to resize <path> to width 800: action=resize, file_path=<path>, width=800, height=600
Add a bottom-left text watermark to <path>: action=watermark, file_path=<path>, type=text, text="©2026", position=bottom_left, font_size=40
Horizontally stitch <IMG1> and <IMG2>: action=stitch, file_path=<IMG1>, file_paths=[<IMG2>], direction=horizontal
If the session is in DSH code tool mode, call indirectly via run_code (e.g., await tools.image_scan({"file_path": "..."})), or set the deployed tools.mode to both.
Use Cases and Considerations¶
Suitable for scenarios where you continue using pure text models in DSH but need to read images, documents, or perform local image editing. In Privacy mode, you can process sensitive screenshots and contract scans without external APIs.
Notes before use:
- The plugin runs with the current dsh process permissions; inspect the source code and MIT license before installation.
- Native thumbnails require enabling visual twin and selecting the “(Visual)” variant; without selection, the text model is not recognized by DSH as supporting images.
image_scan/vision_analyzecurrently do not support WebP; convert to PNG / JPEG first viaimage_edit’sconvert.- Actions like
remove_background,raw_convert,upscalerequire--fullinstallation or additional CLI; if missing, they return installation prompts without crashing. - DSH attachment single image defaults to approximately 5MB; oversized images may be blocked by host upload limits.
As planned, this plugin will later become a built-in vision plugin in DeepSeek Harness EAC, replacing dsh-tool-vision; currently, it is still released as a standalone package for easy installation by non-EAC or older version users.
picturereader converges the image reading pipeline for pure text models into a suite of local tools + optional VLM bridge + visual twin adapter, complementing the image viewing capability on the model inference side in DSH’s “everything is a plugin” ecosystem.
- Community directory: https://www.skillhub.cn/plugins/jing-hy/picturereader
- GitHub: https://github.com/jing-hy/picturereader