Skip to main content

Core library for applying device frames to screenshots.

Project description

device-frames-core

Core library for applying device frames to screenshots.

Install

pip install device-frames-core

Quick Start

from pathlib import Path

from device_frames_core import apply_frame, list_devices

# List all iOS device variations
devices = list_devices(category="iOS")
print(f"Found {len(devices)} iOS device variations")

apply_frame(
    screenshot_path=Path("input.png"),
    device="16 Pro Max",
    variation="Black Titanium",
    output_path=Path("output/framed.png"),
    category="iOS",
)

API

  • list_devices(category=None, device=None) returns a list of available devices and variations, optionally filtered.
  • apply_frame(...) applies a frame using bundled assets and writes an output image.
  • find_template(device, variation, category=None) returns the template data as a dict.
  • get_frame_image(device, variation, category=None) returns the frame image as a PIL Image.
  • get_mask_image(device, variation, category=None) returns the mask image as a PIL Image.

Notes

  • Assets are bundled in the package under device_frames_core/assets.
  • The package depends on Pillow.

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

device_frames_core-0.1.2.tar.gz (20.5 MB view details)

Uploaded Source

Built Distribution

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

device_frames_core-0.1.2-py3-none-any.whl (20.5 MB view details)

Uploaded Python 3

File details

Details for the file device_frames_core-0.1.2.tar.gz.

File metadata

  • Download URL: device_frames_core-0.1.2.tar.gz
  • Upload date:
  • Size: 20.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for device_frames_core-0.1.2.tar.gz
Algorithm Hash digest
SHA256 72b6b705cfef7b9a203921cbad6b3e0c58dea9e73816c09c4ac9646ca6857f98
MD5 73404627336ec520abed6f91374665bd
BLAKE2b-256 44d9a42b3ab677161e80c0bdac1fecff727fce0a53a562798a5f64899bf598d6

See more details on using hashes here.

File details

Details for the file device_frames_core-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for device_frames_core-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 30d51a436bf8ad0d4245b899e61411dd4b77ae1d1d5ec63fa59ba68faf32a3ea
MD5 8c0f053ad76878d071e4f73a46fa72ab
BLAKE2b-256 385aa1d068b3de225ec0c1939229fb017eaa64e8e891655d8aedc0666c0b1751

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