← 返回 Skills 市场
aipoch-ai

Dpi Upscaler Checker

作者 AIpoch · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
213
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install dpi-upscaler-checker
功能描述
Check image DPI and intelligently upscale low-resolution images using super-resolution
使用说明 (SKILL.md)

DPI Upscaler & Checker

Check if images meet 300 DPI printing standards, and intelligently restore blurry low-resolution images using AI super-resolution technology.

Features

  • DPI Detection: Read and verify image DPI information
  • Intelligent Analysis: Calculate actual print size and pixel density
  • Super-Resolution Restoration: Use Real-ESRGAN algorithm to enhance image clarity
  • Batch Processing: Support single image and batch folder processing
  • Format Support: JPG, PNG, TIFF, BMP, WebP

Use Cases

  • Academic paper figure DPI checking
  • Print image quality pre-inspection
  • Low-resolution material restoration
  • Document scan enhancement

Usage

Check Single Image DPI

python scripts/main.py check --input image.jpg

Batch Check Folder

python scripts/main.py check --input ./images/ --output report.json

Super-Resolution Restoration

python scripts/main.py upscale --input image.jpg --output upscaled.jpg --scale 4

Batch Fix Low DPI Images

python scripts/main.py upscale --input ./images/ --output ./output/ --min-dpi 300 --scale 2

Parameters

Check Command

Parameter Type Default Required Description
--input string - Yes Input image path or folder
--output string stdout No Output report path
--target-dpi int 300 No Target DPI threshold

Upscale Command

Parameter Type Default Required Description
--input string - Yes Input image path or folder
--output string - Yes Output path
--scale int 2 No Scale factor (2/3/4)
--min-dpi int - No Only process images below this DPI
--denoise int 0 No Denoise level (0-3)
--face-enhance flag false No Enable face enhancement

Output Description

DPI Check Report

{
  "file": "image.jpg",
  "dpi": [72, 72],
  "width_px": 1920,
  "height_px": 1080,
  "print_width_cm": 67.7,
  "print_height_cm": 38.1,
  "meets_300dpi": false,
  "recommended_scale": 4.17
}

Restored Image

  • Automatically saved as \x3Coriginal_filename>_upscaled.\x3Cextension>
  • Preserves original EXIF information
  • Sets DPI to 300

Dependencies

  • Python >= 3.8
  • Pillow >= 9.0.0
  • opencv-python >= 4.5.0
  • numpy >= 1.21.0
  • realesrgan (optional, for best results)

Algorithm Description

DPI Calculation

Actual DPI = Pixel dimensions / Physical dimensions
Print size (cm) = Pixel count / DPI * 2.54

Super-Resolution

  • Default use of Real-ESRGAN model
  • Support lightweight bicubic interpolation fallback
  • Intelligent model selection (general/anime/face)

Notes

  1. Input image DPI information may be inaccurate; actual pixel calculation shall prevail
  2. Super-resolution cannot create non-existent information; extremely blurry images have limited improvement
  3. Large file processing requires more memory
  4. GPU acceleration requires CUDA environment (optional)

Risk Assessment

Risk Indicator Assessment Level
Code Execution Python/R scripts executed locally Medium
Network Access No external API calls Low
File System Access Read input files, write output files Medium
Instruction Tampering Standard prompt guidelines Low
Data Exposure Output files saved to workspace Low

Security Checklist

  • No hardcoded credentials or API keys
  • No unauthorized file system access (../)
  • Output does not expose sensitive information
  • Prompt injection protections in place
  • Input file paths validated (no ../ traversal)
  • Output directory restricted to workspace
  • Script execution in sandboxed environment
  • Error messages sanitized (no stack traces exposed)
  • Dependencies audited

Prerequisites

# Python dependencies
pip install -r requirements.txt

Evaluation Criteria

Success Metrics

  • Successfully executes main functionality
  • Output meets quality standards
  • Handles edge cases gracefully
  • Performance is acceptable

Test Cases

  1. Basic Functionality: Standard input → Expected output
  2. Edge Case: Invalid input → Graceful error handling
  3. Performance: Large dataset → Acceptable processing time

Lifecycle Status

  • Current Stage: Draft
  • Next Review Date: 2026-03-06
  • Known Issues: None
  • Planned Improvements:
    • Performance optimization
    • Additional feature support
安全使用建议
This skill appears to implement DPI checks and local upscaling, but before installing or running it consider the following: - EXIF claim mismatch: The README says it preserves EXIF, but the visible code saves images without re-attaching EXIF data. If preserving metadata matters, inspect/modify the script to pass exif=img.info.get('exif') when saving. - Path safety: The script will recurse and read any files under the supplied input path and write to the supplied output path. Provide explicit, sandboxed input/output directories and avoid running against system or home directories. Test on sample data first. - Model files: The code references optional model files (Real-ESRGAN, EDSR .pb). There is no automatic download—obtain trusted model binaries separately and verify checksums. - Dependencies: requirements.txt has duplicate/incorrect entries. Install dependencies in an isolated virtualenv before running. - Truncated file / unknown remainder: The provided main.py snippet is truncated; review the complete script to ensure there are no hidden network calls, telemetry, or unexpected behavior before trusting it with important data. Best practice: run the script in a sandboxed environment (non-root user, container or VM), back up originals, and review/modify the code for EXIF and path-validation fixes if you plan to use it on sensitive files.
功能分析
Type: OpenClaw Skill Name: dpi-upscaler-checker Version: 0.1.0 The skill bundle provides a legitimate utility for checking image DPI and upscaling low-resolution images using AI models (Real-ESRGAN or OpenCV DNN). The core logic in `scripts/main.py` uses standard libraries like Pillow and NumPy to process images and includes safe path handling using `pathlib` to prevent traversal issues during batch processing. The documentation in `SKILL.md` is transparent about the tool's capabilities and risks, and no evidence of malicious intent, data exfiltration, or prompt injection was found.
能力评估
Purpose & Capability
Name/description align with included code: DPIChecker and ImageUpscaler implement DPI measurement and local upscaling using PIL/OpenCV/Real-ESRGAN. No unrelated credentials, binaries, or services are requested.
Instruction Scope
SKILL.md instructs running scripts/main.py for check/upscale which reads input files and writes output files—expected for this tool. However, SKILL.md claims 'preserves original EXIF information' but the shown save() call does not pass EXIF data back into the output image (no exif=... passed), so that claim is inconsistent with code. The checklist mentions path traversal protection, but the code does not show explicit input path sanitization; it will recurse and read any files under the provided input path and write to the output path. No network endpoints or secret access are present in the visible code.
Install Mechanism
There is no install specification (instruction-only), which is lower risk. A requirements.txt is included but not automatically applied; it contains duplicate/incorrect entries (e.g., both 'pil' and 'pillow', 'cv2' and 'opencv-python'), which is sloppy but not directly malicious. The code references model files (e.g., EDSR_x{scale}.pb) and Real-ESRGAN but offers no automated download—user must supply models.
Credentials
The skill requires no environment variables, no credentials, and no special system-wide config. Requested access (filesystem read/write of provided paths) is proportionate to its stated functionality.
Persistence & Privilege
always is false, the skill does not request persistent agent privileges, and there's no evidence it modifies other skills or global agent settings in the visible code.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dpi-upscaler-checker
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dpi-upscaler-checker 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial public release of DPI Upscaler & Checker. - Detects and verifies image DPI, including batch processing support. - Calculates print size and pixel density to assess print readiness. - Upscales low-resolution images using AI-based super-resolution (Real-ESRGAN), with optional face enhancement and denoising. - Supports multiple image formats: JPG, PNG, TIFF, BMP, WebP. - Outputs comprehensive DPI reports and saves upscaled images with preserved metadata. - Includes risk assessment, security checklist, and usage instructions.
元数据
Slug dpi-upscaler-checker
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Dpi Upscaler Checker 是什么?

Check image DPI and intelligently upscale low-resolution images using super-resolution. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 213 次。

如何安装 Dpi Upscaler Checker?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install dpi-upscaler-checker」即可一键安装,无需额外配置。

Dpi Upscaler Checker 是免费的吗?

是的,Dpi Upscaler Checker 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Dpi Upscaler Checker 支持哪些平台?

Dpi Upscaler Checker 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Dpi Upscaler Checker?

由 AIpoch(@aipoch-ai)开发并维护,当前版本 v0.1.0。

💬 留言讨论