← 返回
未分类 中文

Dpi Upscaler Checker

Check image DPI and intelligently upscale low-resolution images using super-resolution
检测图像 DPI,使用超分辨率智能放大低分辨率图像
aipoch-ai aipoch-ai 来源
未分类 clawhub v0.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 495
下载
💾 0
安装
1
版本
#latest

概述

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

ParameterTypeDefaultRequiredDescription
-------------------------------------------------
--inputstring-YesInput image path or folder
--outputstringstdoutNoOutput report path
--target-dpiint300NoTarget DPI threshold

Upscale Command

ParameterTypeDefaultRequiredDescription
-------------------------------------------------
--inputstring-YesInput image path or folder
--outputstring-YesOutput path
--scaleint2NoScale factor (2/3/4)
--min-dpiint-NoOnly process images below this DPI
--denoiseint0NoDenoise level (0-3)
--face-enhanceflagfalseNoEnable 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 _upscaled.
  • 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 IndicatorAssessmentLevel
-----------------------------------
Code ExecutionPython/R scripts executed locallyMedium
Network AccessNo external API callsLow
File System AccessRead input files, write output filesMedium
Instruction TamperingStandard prompt guidelinesLow
Data ExposureOutput files saved to workspaceLow

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

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-02 09:27 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Journal Matchmaker

aipoch-ai
根据摘要内容推荐合适的高影响因子或领域期刊,以便提交稿件;当用户提供论文摘要时触发。
★ 0 📥 838
data-analysis

Survival Analysis (KM)

aipoch-ai
生成Kaplan‑Meier生存曲线,计算生存统计量(log‑rank检验、中位生存时间),并估算临床及生物...的 hazard ratios。
★ 2 📥 942
data-analysis

Medical Research Literature Reader Pro

aipoch-ai
一种面向临床、生物信息、转化及基础实验背景用户的医学研究原生文献阅读技能。使用此技能……
★ 1 📥 848