Skip to content
This repository was archived by the owner on Apr 3, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ulackroad image optimizer

Part of BlackRoad OS — Sovereign Computing for Everyone

BlackRoad OS BlackRoad Media License

ulackroad image optimizer is part of the BlackRoad OS ecosystem — a sovereign, distributed operating system built on edge computing, local AI, and mesh networking by BlackRoad OS, Inc.

About BlackRoad OS

BlackRoad OS is a sovereign computing platform that runs AI locally on your own hardware. No cloud dependencies. No API keys. No surveillance. Built by BlackRoad OS, Inc., a Delaware C-Corp founded in 2025.

Key Features

  • Local AI — Run LLMs on Raspberry Pi, Hailo-8, and commodity hardware
  • Mesh Networking — WireGuard VPN, NATS pub/sub, peer-to-peer communication
  • Edge Computing — 52 TOPS of AI acceleration across a Pi fleet
  • Self-Hosted Everything — Git, DNS, storage, CI/CD, chat — all sovereign
  • Zero Cloud Dependencies — Your data stays on your hardware

The BlackRoad Ecosystem

Organization Focus
BlackRoad OS Core platform and applications
BlackRoad OS, Inc. Corporate and enterprise
BlackRoad AI Artificial intelligence and ML
BlackRoad Hardware Edge hardware and IoT
BlackRoad Security Cybersecurity and auditing
BlackRoad Quantum Quantum computing research
BlackRoad Agents Autonomous AI agents
BlackRoad Network Mesh and distributed networking
BlackRoad Education Learning and tutoring platforms
BlackRoad Labs Research and experiments
BlackRoad Cloud Self-hosted cloud infrastructure
BlackRoad Forge Developer tools and utilities

Links


Image optimization, resizing, and CDN pipeline

Part of the BlackRoad OS ecosystem — BlackRoad-Media


BlackRoad Image Optimizer

Image optimization, resizing, and CDN pipeline — part of the BlackRoad Media suite.

CI

Features

  • Multi-format output: JPEG, WebP, AVIF, PNG
  • Smart resizing: Area-ratio based size calculation (no external dependencies)
  • CDN integration: Automatic CDN URL generation and cache management
  • Responsive sets: Auto-generate mobile/tablet/desktop/retina variants
  • srcset generation: HTML-ready srcset attribute strings
  • Batch processing: Optimize multiple images at once
  • Savings estimation: Pre-flight compression estimation
  • SQLite persistence: Jobs, variants, and CDN entries stored

Quick Start

pip install -r requirements.txt
python image_optimizer.py

Usage

from image_optimizer import create_optimizer

opt = create_optimizer()

# Create responsive image set
job = opt.create_responsive_set("https://example.com/hero.jpg")
result = opt.process(job.id)

# Get HTML srcset
srcset = opt.generate_srcset(job.id)
# → "https://cdn.../mobile.webp 480w, https://cdn.../desktop.webp 1200w, ..."

# Batch process
results = opt.optimize_batch(["https://example.com/img1.jpg", "https://example.com/img2.jpg"])

# Estimate savings
estimate = opt.estimate_savings("https://example.com/large.jpg", "avif", 80)
print(f"Estimated savings: {estimate['estimated_savings_percent']}%")

Responsive Variants

Name Width Format Quality
mobile 480px WebP 80
tablet 768px WebP 82
desktop 1200px WebP 85
retina 2400px WebP 85
mobile-jpeg 480px JPEG 75
desktop-avif 1200px AVIF 80

Testing

pytest tests/ -v --cov=image_optimizer

License

Proprietary — © BlackRoad OS, Inc.

About

ulackroad image optimizer — Part of the BlackRoad OS ecosystem. Sovereign computing, edge AI, mesh networking. blackroad.io

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages