{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-other-dpi-upscaler-checker-7ab662312318","title":"DPI Checker & AI Image Upscaler","summary":"Check if images meet 300 DPI printing standards and upscale low-resolution images using AI super-resolution technology. Deliverables include structured reports and upscaled image files.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-dpi-upscaler-checker-7ab662312318","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-dpi-upscaler-checker-7ab662312318","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-dpi-upscaler-checker-7ab662312318.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-dpi-upscaler-checker-7ab662312318\/download","category":{"slug":"product-design","name":"Product & Design"},"editor_note":"Ensure the `--input` path is provided before processing. The tool requires Python 3.8 or higher and specific libraries such as Pillow, opencv-python, and numpy. For batch processing, use the `--input` parameter with a folder path and specify the `--output` directory for results.","instructions":"---\nname: dpi-upscaler-checker\ndescription: Check if images meet 300 DPI printing standards, and intelligently restore blurry low-resolution images using AI super-resolution technology.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n# DPI Upscaler & Checker\n\nCheck if images meet 300 DPI printing standards, and intelligently restore blurry low-resolution images using AI super-resolution technology.\n\n## Input Validation\n\nThis skill accepts: image files (JPG, PNG, TIFF, BMP, WebP) or folder paths for DPI checking and\/or AI super-resolution upscaling.\n\nIf the user's request does not involve image DPI checking or upscaling \u2014 for example, asking to analyze text documents, process audio files, or perform general data analysis \u2014 do not proceed with the workflow. Instead respond:\n> \"dpi-upscaler-checker is designed to check image DPI standards and restore low-resolution images. Your request appears to be outside this scope. Please provide an image file path or folder, or use a more appropriate tool for your task.\"\n\nDo not continue the workflow when the request is out of scope, missing a critical input (`--input` path), or would require unsupported assumptions. For missing inputs, state exactly which fields are missing.\n\n## When to Use\n\n- Check whether images meet 300 DPI printing standards\n- Upscale or restore low-resolution images using AI super-resolution\n- Batch-process folders of mixed-DPI images for print readiness\n\n## Quick Check\n\n```bash\npython -m py_compile scripts\/main.py\npython scripts\/main.py --help\npython scripts\/main.py --demo\npython -c \"import PIL; print('Pillow OK')\"\npython scripts\/main.py check --input image.jpg --json\n```\n\n## Workflow\n\n1. **Validate input first** \u2014 confirm the request is within scope and `--input` path is provided before any processing.\n2. Confirm the user objective, required inputs, and non-negotiable constraints.\n3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.\n4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.\n5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.\n\n## Usage\n\n### Check Single Image DPI\n```text\npython scripts\/main.py check --input image.jpg\npython scripts\/main.py check --input image.jpg --json        # JSON to stdout for agent consumption\n```\n\n### Batch Check Folder\n```text\npython scripts\/main.py check --input .\/images\/ --output report.json\n```\n\n### Super-Resolution Restoration\n```text\npython scripts\/main.py upscale --input image.jpg --output upscaled.jpg --scale 4\n```\n\n### Batch Fix Low DPI Images\n```text\npython scripts\/main.py upscale --input .\/images\/ --output .\/output\/ --min-dpi 300 --scale 2\n```\n\n### Demo Mode (no real images required)\n```text\npython scripts\/main.py --demo\n```\n\n## Parameters\n\n### Check Command\n| Parameter | Type | Default | Required | Description |\n|-----------|------|---------|----------|-------------|\n| `--input` | string | - | Yes | Input image path or folder |\n| `--output` | string | stdout | No | Output report path |\n| `--target-dpi` | int | 300 | No | Target DPI threshold |\n| `--json` | flag | false | No | Output results as JSON to stdout |\n\n### Upscale Command\n| Parameter | Type | Default | Required | Description |\n|-----------|------|---------|----------|-------------|\n| `--input` | string | - | Yes | Input image path or folder |\n| `--output` | string | - | Yes | Output path |\n| `--scale` | int | 2 | No | Scale factor (2\/3\/4) |\n| `--min-dpi` | int | - | No | Only process images below this DPI |\n| `--denoise` | int | 0 | No | Denoise level (0-3) |\n| `--face-enhance` | flag | false | No | Enable face enhancement |\n\n## Output\n\n### DPI Check Report (JSON)\n```json\n{\n  \"file\": \"image.jpg\",\n  \"dpi\": [72, 72],\n  \"width_px\": 1920,\n  \"height_px\": 1080,\n  \"print_width_cm\": 67.7,\n  \"print_height_cm\": 38.1,\n  \"meets_300dpi\": false,\n  \"recommended_scale\": 4.17\n}\n```\n\n### Restored Image\n- Saved as `<original_filename>_upscaled.<extension>`\n- Preserves original EXIF information\n- Sets DPI metadata to target value\n\n## Algorithm\n\n- DPI: `print_size_cm = (pixel_count \/ dpi) * 2.54`; `recommended_scale = target_dpi \/ avg_dpi`\n- Super-resolution fallback chain: Real-ESRGAN \u2192 OpenCV DNN \u2192 PIL Lanczos\n- RGBA alpha channel upscaled separately and reattached\n\n## Known Limitations\n\n- Super-resolution cannot create non-existent information; extremely blurry images have limited improvement\n- GPU acceleration requires CUDA environment (optional)\n- Batch upscale mode does not currently save a JSON summary report (only check mode saves JSON to `--output`)\n- EXIF parsing uses `except (AttributeError, KeyError, TypeError, ZeroDivisionError)` \u2014 bare except replaced with specific exception types\n- Output format parameters are conditioned on file extension (JPEG: `quality=95`; PNG: `compress_level=6`)\n- Batch processing uses `Path.rglob`; resolve paths with `path.resolve()` before processing to avoid unexpected directory traversal via symlinks\n\n## Fallback Behavior\n\nIf `scripts\/main.py` fails or required inputs are incomplete:\n1. Report the exact failure point and error message (sanitized \u2014 no internal paths).\n2. State what can still be completed safely (e.g., DPI check without upscale).\n3. Manual fallback: `from PIL import Image; img = Image.open('file.jpg'); print(img.info.get('dpi'))`.\n4. Do not fabricate execution outcomes or file contents.\n\n## Error Handling\n\n- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.\n- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.\n- If `scripts\/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.\n- Do not fabricate files, citations, data, search results, or execution outcomes.\n- Script exits with non-zero code on error in both check and upscale modes.\n\n## Response Template\n\n1. Objective\n2. Inputs Received\n3. Assumptions\n4. Workflow\n5. Deliverable\n6. Risks and Limits\n7. Next Checks\n\n## Dependencies\n\n- Python >= 3.8\n- Pillow >= 9.0.0\n- opencv-python >= 4.5.0\n- numpy >= 1.21.0\n- realesrgan (optional, for best results)\n\n```text\npip install -r requirements.txt\n```\n","use_cases":["Check if images meet 300 DPI printing standards","Restore blurry low-resolution images using AI super-resolution","Batch-process folders of mixed-DPI images for print readiness"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Other\/dpi-upscaler-checker\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-26","created_at":"2026-11-24T14:44:51.000000Z","updated_at":"2026-11-26T09:24:51.000000Z","seo_title":"DPI Checker & AI Image Upscaler Tool","seo_description":"Check image DPI standards and upscale low-resolution images with AI super-resolution. Ideal for print readiness and image restoration.","seo_keywords":["DPI checker tool","AI image upscaler","Image print readiness","Low-resolution image restoration","Batch image DPI check"]}}