skillfed

loadimg

a python package for loading images

loadimg v0.5.0 82.8K downloads/30d#14,128 on PyPI30
Permissive license Apache 2.0 License Active released

What it is and what it does

loadimg is a lightweight image-loading utility that abstracts away format conversion boilerplate. It takes an image in any of several input forms—a file path, a URL, a numpy array, a PIL Image, or a base64 string—and converts it to your chosen output format with a single function call. The package includes automatic format detection, so you can pass `input_type="auto"` and let it figure out what you've given it.

The main use case is simplifying image handling in workflows that mix different libraries or APIs. For example, if you're building a chatbot that sends images to Hugging Face or OpenAI, you can load a remote image and immediately convert it to base64 without writing format-detection or encoding logic yourself. It has no external dependencies beyond what Python provides, making it quick to install and integrate.

Use it for:

  • Convert images to base64 for API calls to Hugging Face, OpenAI, or FAL without manual encoding.
  • Load images from URLs or local paths and convert to numpy arrays for ML model input.
  • Normalize image input in a library or CLI tool that accepts multiple image sources.
  • Switch between PIL and numpy representations without writing format-specific code.
  • Build image preprocessing pipelines that accept flexible input types.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Loads and converts images between multiple formats—numpy arrays, PIL objects, file paths, URLs, and base64 strings—with automatic format detection.

Yes. The package is actively maintained, has no dependencies, installs instantly, and solves a real friction point in image-handling code. It's especially useful if you work with multiple image APIs or mix PIL and numpy in the same project. The permissive license and low install friction make it a low-risk addition.

Install

loadimg on PyPI

pip

pip install loadimg

uv

uv add loadimg

poetry

poetry add loadimg

Installing loadimg

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits and regular releases since March 2024.

License in practice

Apache 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install loadimg

from loadimg import load_img

# Load from URL, convert to base64
img_b64 = load_img("https://example.com/image.jpg", output_type="base64")

# Load from file, convert to numpy
img_array = load_img("/path/to/image.png", output_type="numpy")

Verify before relying

  • Whether the package handles all common image formats (JPEG, PNG, GIF, WebP, etc.) or only a subset.
  • Performance characteristics when loading large images or many images in sequence.
  • Whether URL loading respects timeouts and handles redirects or authentication.
  • Exact Python version compatibility (requires_python is unspecified in metadata).

Package facts

License Apache 2.0 License (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 388 days since the last release
Last repo commit
First released
Downloads 82,847/month — #14,128 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: loadimg-0.5.0-py3-none-any.whl

Programming Language :: Python :: 3.9Topic :: Utilities

Tags

image format conversionload image from urlnumpy to pil conversionbase64 image encodingauto-detect image format
image-conversionformat-agnostic

More Utilities packages