{"id":23989,"library":"loadimg","title":"loadimg - Image loading utility","description":"loadimg is a Python package for loading images from various sources (local files, URLs, base64 strings) and converting to multiple output types (PIL, numpy, base64, ASCII art, URL). Current version 0.5.0, released 2025-03-18. Active development.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/not-lain/loadimg","tags":["image-loading","pil","numpy","base64","ascii-art"],"install":[{"cmd":"pip install loadimg","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"required for PIL and numpy output","package":"Pillow","optional":false},{"reason":"required for numpy output","package":"numpy","optional":true},{"reason":"required for loading from URLs","package":"requests","optional":false}],"imports":[{"note":"In versions 0.3.x and earlier, the import was from loadimg; changed in 0.4.0+ but many docs still show old pattern. Use the new path.","wrong":"from loadimg import load_img","symbol":"load_img","correct":"from loadimg.utils import load_img"},{"note":"Same as load_img; moved to utils in 0.4.0.","wrong":"from loadimg import load_imgs","symbol":"load_imgs","correct":"from loadimg.utils import load_imgs"}],"quickstart":{"code":"from loadimg.utils import load_img\nimg = load_img('https://example.com/image.jpg', output_type='pil')\nprint(type(img))","lang":"python","description":"Load an image from URL as PIL Image."},"warnings":[{"fix":"Use `from loadimg.utils import load_img`.","message":"In v0.4.0, import paths changed from `loadimg` to `loadimg.utils`. Code using `from loadimg import load_img` will break.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Explicitly specify `output_type='pil'` to get PIL Image.","message":"In v0.3.0, the `output_type` parameter was introduced. Old code without `output_type` may return bytes instead of PIL Image.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Use `input_type='base64'` when passing a base64 string.","message":"The `load_img` function does not automatically detect input type; you must specify `input_type` for non-URL sources (e.g., base64).","severity":"gotcha","affected_versions":"all"},{"fix":"Check release notes for updates.","message":"The `load_imgs` function (plural) was added in v0.5.0 but may change signature in future releases.","severity":"deprecated","affected_versions":"0.5.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure loadimg >=0.4.0 is installed: `pip install --upgrade loadimg`","cause":"Installation of loadimg failed or version <0.4.0 where utils module didn't exist.","error":"ModuleNotFoundError: No module named 'loadimg.utils'"},{"fix":"Change to `from loadimg.utils import load_img`","cause":"Using old import `from loadimg import load_img` with loadimg >=0.4.0.","error":"AttributeError: module 'loadimg' has no attribute 'load_img'"},{"fix":"Install Pillow: `pip install pillow`","cause":"Pillow is not installed. PIL output requires the Pillow package.","error":"ValueError: Unsupported output type: 'pil'"},{"fix":"Use an absolute path or prefix with 'file://', or use the `path` input_type (not yet supported). Alternatively, pass as base64.","cause":"Passing a local file path without prefix; load_img expects a URL or base64.","error":"requests.exceptions.MissingSchema: Invalid URL 'file.jpg': No schema supplied."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}