Skip to content

MukundaKatta/PhotoTag

Repository files navigation

PhotoTag

CI Python 3.9+ License: MIT Code style: black

Image auto-tagging engine — a Python library that generates descriptive tags for images based on color analysis, brightness, dimensions, and EXIF metadata.


Architecture

graph LR
    A[Input Image] --> B[PhotoTag.load_image]
    B --> C[analyze]
    C --> D[tag_colors]
    C --> E[tag_brightness]
    C --> F[tag_dimensions]
    C --> G[tag_content_type]
    D --> H[Tag Set]
    E --> H
    F --> H
    G --> H
    H --> I[export_tags]
    I --> J[JSON / CSV / dict]
Loading
graph TD
    subgraph phototag
        core[core.py — PhotoTag class]
        config[config.py — Settings]
        utils[utils.py — Analysis helpers]
    end
    core --> config
    core --> utils
Loading

Quickstart

Installation

pip install -e .

Basic Usage

from phototag import PhotoTag

pt = PhotoTag()

# Tag a single image
image = pt.load_image("photo.jpg")
tags = pt.get_all_tags(image)
print(tags)
# ['bright', 'landscape', 'colorful', 'dominant:blue', 'high-res', 'photograph']

# Export tags
pt.export_tags(tags, format="json")

# Batch tagging
results = pt.batch_tag(["img1.jpg", "img2.png", "img3.jpeg"])
for path, tags in results.items():
    print(f"{path}: {tags}")

CLI Quick Test

python -c "
from phototag import PhotoTag
pt = PhotoTag()
# Create a synthetic test image
from PIL import Image
img = Image.new('RGB', (1920, 1080), color=(30, 120, 200))
tags = pt.get_all_tags(img)
print('Tags:', tags)
"

Features

  • Color analysis — detect dominant colors, classify as colorful or monochrome
  • Brightness detection — tag images as bright, dark, or neutral
  • Dimension classification — landscape, portrait, square, high-res, thumbnail
  • Content type heuristics — photograph, graphic, icon detection
  • EXIF metadata — extract camera info and orientation when available
  • Batch processing — tag multiple images in a single call
  • Export formats — JSON, CSV, or plain dict output

Development

make install    # Install in development mode
make test       # Run tests
make lint       # Run linter
make format     # Format code with black

Inspiration

Inspired by image classification and tagging trends in modern computer vision pipelines.


Built by Officethree Technologies | Made with love and AI

About

Image auto-tagging engine — color analysis, brightness, dimensions, content type classification

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors