Skip to main content

A deterministic infinite image library generator inspired by Borges' 'The Library of Babel'. Generate unique, deterministic images based on coordinate systems without storing image data.

Project description

Babylonian Image Library v1.0.0


A deterministic infinite image library generator inspired by Borges' 'The Library of Babel'. Generate unique, deterministic images based on coordinate systems without storing image data.


PyPI Downloads GitHub top language GitHub release (latest by date) GitHub GitHub Repo stars GitHub watchers GitHub forks PyPI - Downloads PyPI PyPI - Format


🚧 Project Status: Research & Development

IMPORTANT DISCLAIMER: This project is currently in active research and development phase. It is provided as-is for academic and experimental purposes only. No guarantees of stability, security, or fitness for any particular purpose are provided. Users assume all risks associated with usage.


🚀 Version Information

Current Version: 1.0.0 (New Modular Architecture)

Complete rewrite with breaking changes - this version introduces a completely new architecture inspired by the Smart Babylon Library:

  • 🌌 Multi-Universe Support - Isolated image libraries with different configurations
  • 📐 6D Coordinate System - Floor, room, cabinet, shelf, book, page coordinates
  • 🎯 Deterministic Generation - Same coordinates always produce the same image
  • 🏠 Home Directory Storage - Organized storage in ~/babylonian_image_library/
  • 🖼️ Multiple Image Types - Standard and abstract image generation
  • ⚙️ Configurable Settings - Custom dimensions, formats, and quality
  • 📦 Modular Architecture - Clean separation with config, coordinates, core, and generator modules

Legacy Version: 0.1.4 (Deprecated)

⚠️ Version 0.1.4 and earlier are no longer supported. The previous monolithic architecture has been completely replaced by the new modular system.

Key breaking changes from 0.1.4 to 1.0.0:

  • New import paths: from babylonian_image_library import SmartBabylonImageLibrary
  • Different coordinate system: 6D coordinates instead of address strings
  • Modular structure: Separate config, coordinates, core, and generator modules
  • Multi-universe support: Isolated libraries with different configurations
  • Home directory storage: Automatic organization in user's home folder
  • Enhanced API: Object-oriented interface with better type safety

📚 Related Research Publications

This library implements concepts from our published research:

Features

  • Deterministic Image Generation: Same coordinates always produce the same image
  • Infinite Image Library: Virtually unlimited images through coordinate system
  • Zero Image Storage: Images generated on-demand, only metadata stored
  • Multi-Universe Support: Isolated libraries with different configurations
  • Home Directory Storage: Automatic organization in user's home directory
  • Configurable: Custom image dimensions, formats, and quality
  • Abstract Art Generation: Algorithmic abstract image creation
  • Modular Design: Clean, maintainable architecture

Installation

pip install babylonian-image-library

Quick Start

from babylonian_image_library import SmartBabylonImageLibrary

# Create library instance
library = SmartBabylonImageLibrary()

# Generate a random image
image_path = library.generate_random_image()
print(f"Image saved: {image_path}")

# Get specific image by coordinates
image = library.get_image(floor=1, room=3, cabinet=2, shelf=5, book=42, page=1)
image.save("specific_image.png")

Architecture

The library follows a modular architecture:

babylonian_image_library/
├── library/
│   ├── config.py      # ImageLibraryConfig
│   ├── coordinates.py # ImageCoordinates  
│   ├── core.py        # BabylonianImageLibrary, SmartBabylonImageLibrary
│   └── generator.py   # BabylonianImageGenerator

Coordinate System

Each image is located using 6-dimensional coordinates:

  • floor: Library floor (0-100)
  • room: Room number (0-50)
  • cabinet: Cabinet number (0-20)
  • shelf: Shelf number (0-10)
  • book: Book number (0-1000)
  • page: Page number (0-500)

Configuration

from babylonian_image_library import SmartBabylonImageLibrary, ImageLibraryConfig

# Custom configuration
config = ImageLibraryConfig(
    universe="abstract_art",    # Universe name
    width=800,                  # Image width
    height=600,                 # Image height
    image_format="JPEG",        # PNG, JPEG, etc.
    quality=90                  # JPEG quality (1-100)
)

library = SmartBabylonImageLibrary(config)

Migration Guide from 0.1.4 to 1.0.0

Before (0.1.4):

from babylonian_image_library import BabylonianImageLibrary

library = BabylonianImageLibrary()
address = library.generate_random_address()  # "Room42:Wall3:Shelf7:Volume5:Book23:Page456"
library.save_image(address, "image.png")

After (1.0.0):

from babylonian_image_library import SmartBabylonImageLibrary

library = SmartBabylonImageLibrary()
image_path = library.generate_random_image()  # Automatically generates coordinates
# Or use specific coordinates:
image = library.get_image(floor=1, room=3, cabinet=2, shelf=5, book=42, page=1)

Multi-Universe Support

from babylonian_image_library import SmartBabylonImageLibrary, ImageLibraryConfig

# Different universes - different images
fantasy_config = ImageLibraryConfig(universe="middle_earth")
scifi_config = ImageLibraryConfig(universe="andromeda_galaxy")

fantasy_library = SmartBabylonImageLibrary(fantasy_config)
scifi_library = SmartBabylonImageLibrary(scifi_config)

# Same coordinates, different images
fantasy_image = fantasy_library.get_image(1, 1, 1, 1, 1, 1)
scifi_image = scifi_library.get_image(1, 1, 1, 1, 1, 1)

API Reference

SmartBabylonImageLibrary

Main library interface:

  • get_image(floor, room, cabinet, shelf, book, page) - Get image by coordinates
  • get_abstract_image(floor, room, cabinet, shelf, book, page) - Get abstract image
  • save_image(floor, room, cabinet, shelf, book, page, filename) - Save image to file
  • save_abstract_image(floor, room, cabinet, shelf, book, page, filename) - Save abstract image
  • generate_random_image() - Generate and save random image
  • get_library_info() - Get library information

ImageLibraryConfig

Configuration class:

  • universe - Universe name (default: "default")
  • width - Image width (default: 1920)
  • height - Image height (default: 1080)
  • image_format - Image format (default: "PNG")
  • quality - JPEG quality (default: 95)

ImageCoordinates

Coordinate class:

  • floor, room, cabinet, shelf, book, page - Coordinate components
  • seed - Combined seed string for generation
  • to_dict() - Convert to dictionary
  • to_json() - Convert to JSON string

Examples

Basic Usage

from babylonian_image_library import SmartBabylonImageLibrary

library = SmartBabylonImageLibrary()

# Generate multiple random images
for i in range(5):
    path = library.generate_random_image()
    print(f"Generated: {path}")

# Get library information
info = library.get_library_info()
print(f"Library location: {info['library_path']}")
print(f"Total images: {info['total_images']}")

Working with Coordinates

from babylonian_image_library import ImageCoordinates

# Create specific coordinates
coords = ImageCoordinates(floor=5, room=10, cabinet=3, shelf=2, book=150, page=42)
print(f"Coordinates: {coords}")
print(f"Seed: {coords.seed}")

# Use coordinates with library
image = library.get_image(coords.floor, coords.room, coords.cabinet, 
                         coords.shelf, coords.book, coords.page)

Advanced Usage

from babylonian_image_library import SmartBabylonImageLibrary, ImageLibraryConfig

# Create specialized universe for digital art
art_config = ImageLibraryConfig(
    universe="digital_art",
    width=1024,
    height=768,
    image_format="PNG"
)

art_library = SmartBabylonImageLibrary(art_config)

# Generate a series of abstract artworks
for i in range(10):
    art_library.save_abstract_image(1, 1, 1, 1, i, 0, f"artwork_{i}.png")

Storage Location

Images are automatically stored in:

  • Linux/Mac: ~/babylonian_image_library/{universe}/
  • Windows: C:\Users\{username}\babylonian_image_library\{universe}\

Deterministic Behavior

Image generation is deterministic based on coordinates and universe:

# Same coordinates = same image
library1 = SmartBabylonImageLibrary(ImageLibraryConfig(universe="test"))
library2 = SmartBabylonImageLibrary(ImageLibraryConfig(universe="test"))

image1 = library1.get_image(1, 1, 1, 1, 1, 1)
image2 = library2.get_image(1, 1, 1, 1, 1, 1)

# Images will be identical

⚠️ Important Legal Notice

NO WARRANTY: This software is provided for academic and research purposes only. The authors make no warranties, express or implied, regarding the software's functionality, security, or fitness for any purpose. Users assume all responsibility and risk for use.

RESEARCH STATUS: This implementation is part of ongoing research into deterministic systems and pointer-based architectures. It should not be used in production environments or for any critical applications.

License

BSD 3-Clause License

GitHub

https://github.com/smartlegionlab/babylonian-image-library

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

babylonian_image_library-1.0.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

babylonian_image_library-1.0.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file babylonian_image_library-1.0.0.tar.gz.

File metadata

  • Download URL: babylonian_image_library-1.0.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for babylonian_image_library-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bcafbd48cec5d6edeba4907ccfadd0794a22dae3c7d7b61692e533a51675c6fb
MD5 3efcd7bb2302b1ebe79699adc985354a
BLAKE2b-256 9b30c22ec93309cb9f2937cbf456f11f28a611b7f501f5823f42a27172eb4e9c

See more details on using hashes here.

File details

Details for the file babylonian_image_library-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for babylonian_image_library-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76319980106dd19edda2eed63fc8ec88d310d6596aaf6222d2f3de55f7bb529b
MD5 c2a24bda17fee6ea558cbaafeff1b640
BLAKE2b-256 62cb8d58d43dfd4dc8312e590c622a73b21f314b9f41e4ac5c217ad5d51cc503

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