Skip to main content

A toolkit for processing the ASM's Mammal Image Library (MIL).

Project description

mil-kit

Tests GitHub Tag PyPI - Version

A Python toolkit for batch processing the Mammal Image Library (MIL) images. Reshape, convert, and optimize images for the mammal diversity database and other applications.

Features

  • 🚀 Batch process multiple PSD files in a directory
  • ⚡ Parallel processing for faster execution
  • 📊 Progress bar with detailed status
  • 📝 Automatically hide all text layers
  • 🖼️ Export processed files as PNG (default) or other formats
  • 📁 Support for recursive directory processing
  • ⚡ Preserve folder structure in output

Installation

Install using pip:

pip install mil-kit

Or using uv:

uv add mil-kit

Usage

Command Line

Process PSD files in a directory:

mil-kit -d /path/to/psd/files

Process recursively, specify output directory, and use JPEG format:

mil-kit -d /path/to/psd/files -o /path/to/output -r -f jpeg --max-resolution 500

Options

  • -d, --dir: Input directory containing PSD files (required)
  • -o, --output: Output directory for processed files (default: input directory)
  • -f, --output-format: Output image format (default: png)
  • -r, --recursive: Process subdirectories recursively
  • --max-resolution: Set maximum resolution for output images (if needed)

Python API

You can also use mil-kit as a Python library:

from mil_kit.psd.processor import PSDProcessor
from mil_kit.job import BatchJob

# Process a single file
processor = PSDProcessor("image.psd")
processor.load()
processor.hide_non_image_layers()
processor.export("output.jpg", format="jpeg")

# If you want to export with max resolution
processor.export("output_resized.jpg", format="jpeg", max_resolution=500)

# Batch process
job = BatchJob(
    input_dir="./psd_files",
    output_dir="./output",
    recursive=True,
    output_format="png",
    max_workers=4
)
job.run()

Requirements

  • Python >= 3.10
  • psd-tools >= 1.12.0
  • pillow >= 12.0.0
  • tqdm >= 4.67.1

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues

Report bugs and request features on GitHub Issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mil_kit-0.4.1.tar.gz (70.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mil_kit-0.4.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file mil_kit-0.4.1.tar.gz.

File metadata

  • Download URL: mil_kit-0.4.1.tar.gz
  • Upload date:
  • Size: 70.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mil_kit-0.4.1.tar.gz
Algorithm Hash digest
SHA256 5dc65d262707130e171d3105b0b2276a480e91cf81bc4a971e438063a4ae5f72
MD5 a679454b4255f6c736b466e329116b3c
BLAKE2b-256 bbed3e73d9082223f9e44e74d8b57ce27060e2ddd1202a13ba93aed89443c383

See more details on using hashes here.

File details

Details for the file mil_kit-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: mil_kit-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mil_kit-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9df5b10a2034c0e739708d7c1723f070e2cfb42089fd2b9ee91bbbb42f80d1e
MD5 3311480233d8b5705d94b89968c541f9
BLAKE2b-256 81af9f4c312bcb58582987746152c732d9820dfec8985c54c3d3a1b2b2513669

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page