Check image DPI and intelligently upscale low-resolution images using super-resolution
Check if images meet 300 DPI printing standards, and intelligently restore blurry low-resolution images using AI super-resolution technology.
python scripts/main.py check --input image.jpg
python scripts/main.py check --input ./images/ --output report.json
python scripts/main.py upscale --input image.jpg --output upscaled.jpg --scale 4
python scripts/main.py upscale --input ./images/ --output ./output/ --min-dpi 300 --scale 2
| 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 |
| 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 |
{
"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
}
<original_filename>_upscaled.<extension>Actual DPI = Pixel dimensions / Physical dimensions
Print size (cm) = Pixel count / DPI * 2.54
| 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 |
# Python dependencies
pip install -r requirements.txt