{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-other-id-photo-tool-7c825b491f62","title":"ID Photo Background Color & Watermark Tool","summary":"Replace ID photo backgrounds with blue, white, or red and add text watermarks to JPG\/PNG files using a command-line tool. Output is saved to an explicit path without modifying the original file.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-id-photo-tool-7c825b491f62","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-id-photo-tool-7c825b491f62","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-id-photo-tool-7c825b491f62.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-id-photo-tool-7c825b491f62\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Prerequisites: Python 3.x, pillow (PIL), and numpy must be installed. Install using `python -m pip install pillow numpy` before running the tool.","instructions":"---\nname: id-photo-tool\ndescription: Replace an ID photo background color (blue\/white\/red) and\/or add a configurable text watermark when you need compliant ID-photo variants from local JPG\/PNG files.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n## When to Use\n- You need to convert an ID photo background to a required solid color (blue\/white\/red) for official submissions.\n- You need to add a visible \u201cfor application only\u201d style watermark to prevent misuse of shared ID photos.\n- You need to batch-generate multiple variants while keeping the original image unchanged (explicit output path).\n- You need an offline, local-only tool (no network access) for processing sensitive personal images.\n\n## Key Features\n- Background color replacement for ID photos:\n  - Supported target colors: `blue`, `white`, `red`\n  - Detects the dominant background color using edge pixels and replaces it using color-distance matching\n- Text watermark overlay:\n  - Supported positions: top-left, top-right, bottom-left, bottom-right, center\n  - Configurable opacity, font size, and font color\n- Input\/output constraints:\n  - Supports `JPG` and `PNG` only\n  - Output keeps the same format as the input\n  - Does not overwrite the original file (output path must be provided)\n- Local processing only:\n  - Reads only from user-provided input paths and writes only to user-provided output paths\n\n## Dependencies\n- Python 3.x\n- pillow (PIL) \u2014 version not pinned\n- numpy \u2014 version not pinned\n\nInstall:\n```bash\npython -m pip install pillow numpy\n```\n\n## Example Usage\nBackground color replacement (JPG):\n```bash\npython scripts\/id_photo_tool.py change-bg \\\n  --input input.jpg \\\n  --output output.jpg \\\n  --color blue\n```\n\nBackground color replacement (PNG):\n```bash\npython scripts\/id_photo_tool.py change-bg \\\n  --input input.png \\\n  --output output.png \\\n  --color white\n```\n\nAdd a text watermark:\n```bash\npython scripts\/id_photo_tool.py add-watermark \\\n  --input input.jpg \\\n  --output watermarked.jpg \\\n  --text \"For application use only\"\n```\n\n## Implementation Details\n### Background Color Replacement\n- **Background sampling**: The tool estimates the original background color by sampling pixels along the image edges (where background is most likely present).\n- **Color-distance based replacement**: Pixels close to the estimated background color (by color distance) are treated as background and replaced with the selected target color.\n- **Supported target colors**:\n  - `blue`\n  - `white`\n  - `red`\n\n### Text Watermark\n- **Placement**: One of five positions is supported: top-left, top-right, bottom-left, bottom-right, center.\n- **Rendering parameters**:\n  - Opacity controls watermark transparency.\n  - Font size controls text scale.\n  - Font color controls text color.\n- **Output behavior**: The watermark is composited onto the image and saved to the specified output path without modifying the original input file.\n\n### Security \/ Compliance Notes\n- No network access is used; all processing is performed locally.\n- The script only accesses file paths explicitly provided via CLI arguments.\n- The tool requires an explicit output path and does not overwrite the original file by default.","use_cases":["Convert ID photo background to required solid color for official submissions.","Add a visible watermark to prevent misuse of shared ID photos.","Batch-generate multiple ID photo variants without modifying the original file."],"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\/id-photo-tool\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-26","created_at":"2026-11-24T15:01:39.000000Z","updated_at":"2026-11-26T09:25:02.000000Z","seo_title":"ID Photo Background Color & Watermark Tool","seo_description":"Replace ID photo backgrounds with blue\/white\/red or add text watermarks using a command-line tool for JPG\/PNG files. Processes images locally without network access.","seo_keywords":["ID photo background changer","watermark ID photo","change ID photo background","ID photo editor","add watermark to photo"]}}