Automated image preparation and compression tool.
AutoPics is a desktop application for preparing and compressing product or catalog images in batches. It provides a Qt-based GUI for selecting source/output folders, applying optional image cleanup/enhancement steps, and exporting optimized files in modern formats.
- Batch-processes images from a source folder into a target
compfolder. - Supports output to JPEG, AVIF, JPEG XL, and PNG.
- Lets you choose quality presets (High / Medium / Low) or enforce a target size standard.
PNG High / Medium / Low reduce the image to a colour palette with libimagequant (alpha kept); the size target works for these too.
The PNG Dither slider (0-100%, default from
standardPngDitherindefaults.txt) trades a little file size for less banding. - Lossless option for PNG (Pillow optimised), JPEG XL (true lossless) and AVIF (near-lossless: max quality, 4:4:4). Lossless files can't be sized to the target.
- Includes optional image operations:
- automatic trimming of flat-color borders,
- color enhancement,
- sharpness enhancement,
- standard or custom max-dimension resize,
- keep transparent backgrounds (PNG / AVIF / JPEG XL output) instead of flattening onto white.
- Uses parallel processing to speed up large batches.
- Displays run results in-app and previews output images while processing.
- Python
- PySide6 for the desktop GUI
- Pillow for image manipulation
- pillow-avif-plugin and pillow-jxl-plugin for AVIF/JXL support
- imagequant (libimagequant) for lossy PNG palettes and dithering
- Python 3.14+ (as defined in
pyproject.toml) - A platform supported by PySide6 and your selected image codec plugins
This project uses uv in its lockfile workflow.
uv syncIf you do not use uv, install dependencies manually from pyproject.toml:
pip install pyside6 pillow-avif-plugin pillow-jxl-plugin imagequantFrom the project root:
uv run AutoPics.py- Click Browse and select your source image folder.
- Confirm or adjust the output
compfolder path. - (Optional) Enter a rename prefix for generated files.
- Configure settings:
- quality mode,
- resize behavior,
- output format,
- enhancement options.
- Click Process.
- Review the output summary and generated files in the
compfolder.
AutoPics.py— main GUI application.picComp.py— batch orchestration, encoding logic, and multiprocessing pipeline.imageEditing.py— reusable image editing utilities.standards.py— loadsdefaults.txt; shared by the GUI and the MCP server.mcp_server.py— MCP server exposing the pipeline to an AI agent.third_party_licenses/— bundled third-party license texts.
mcp_server.py exposes the same pipeline over the Model Context Protocol, so an
AI agent can inspect a folder of images and compress it without the GUI. It runs
headless — it imports picComp and imageEditing directly and never starts Qt.
uv sync --group mcpCopy .env.example to .env and set AUTOPICS_ALLOWED_ROOTS to the folders the
server is allowed to touch. Then register it in Claude Desktop's
claude_desktop_config.json:
"autopics": {
"command": "C:\\Users\\jp\\Desktop\\CodeProjects\\AutoPics\\.venv\\Scripts\\python.exe",
"args": ["C:\\Users\\jp\\Desktop\\CodeProjects\\AutoPics\\mcp_server.py"]
}| Tool | What it does |
|---|---|
autopics_inspect_images |
Read-only. Dimensions, size, format, mode and alpha for files or a folder. |
autopics_get_defaults |
Read-only. The standards from defaults.txt and what each one controls. |
autopics_compress_batch |
The Process button. Compresses a folder or file list; supports dry_run. |
autopics_process_image |
Edits and encodes a single image to an explicit output path. |
| Variable | Default | Meaning |
|---|---|---|
AUTOPICS_ALLOWED_ROOTS |
unset | Comma-separated directories the server may read and write. Unset means no restriction, which is not recommended when an agent is driving. |
AUTOPICS_MAX_IMAGES |
200 |
Batches larger than this are refused before anything is written. |
AUTOPICS_TIMEOUT_SECONDS |
600 |
Wall-clock limit for one tool call. |
AUTOPICS_MAX_WORKERS |
CPU default | Worker count for the batch pool. |
- stdout is the JSON-RPC channel. Nothing in the pipeline may print to it, so
picCompandimageEditinglog throughstandards.log(), which writes to stderr, andmcp_server.pyadditionally redirects file descriptor 1 to stderr so worker processes cannot corrupt the protocol. - The MCP path uses threads, the GUI uses processes. A spawned
ProcessPoolExecutordoes not survive running inside the stdio server process — the workers start, do the work, and their results never come back.PicComp(use_processes=False)switches to aThreadPoolExecutor; Pillow releases the GIL during encode and decode, so this is no slower in practice. - The server pins
mcp<2. Version 2.x renamesFastMCPtoMCPServerand changes other APIs.
- Project license: see
LICENSE. - Third-party notices: see files under [
third_party_licenses/](thiAutomated image preparation and compression tool. - Third-party notices: see files under
third_party_licenses/.