Metadata-Version: 2.4
Name: screenshot-framer
Version: 0.2.0
Summary: A robust, Pillow-based alternative to fastlane frameit for composing premium mobile marketing screenshots.
Home-page: https://github.com/ahmedtikiwa/screenshot-framer
Author: Ahmed Tikiwa
Author-email: hello@ahmedtikiwa.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: Pillow>=9.0.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# screenshot-framer

A robust, Python-based CLI tool to composite premium marketing screenshots for iOS and Android applications. 

`screenshot-framer` was built as a lightweight, flexible alternative to `fastlane frameit`. It bypasses the common system-level ImageMagick/FreeType font rendering failures by relying entirely on Python's self-contained `Pillow` library for image composition, device rounding, drop shadows, and responsive text overlay.

## Features

- **No ImageMagick Required**: Pure Python image manipulation using `Pillow`.
- **Cross-Platform Auto-Detection**: Dynamically detects iOS (flat directories) and Android (nested `phoneScreenshots`, `sevenInchScreenshots`, `tenInchScreenshots`) architectures and automatically applies the correct scaling and border radii.
- **Dynamic Text Scaling**: Automatically scales down long titles so they never clip off the edge of your marketing canvas.
- **Modern Device Styling**: Instead of forcing clunky hardware bezels onto your UI, it elegantly rounds the corners of your raw screenshots and applies a premium Gaussian drop-shadow, floating it over your chosen background.
- **Fastlane Compatible**: Can parse your existing `title.strings` and `keyword.strings` files directly.

## Installation

```bash
pip install screenshot-framer
```

## Usage

Create a configuration JSON file (e.g. `framer_config.json`) in your project:

```json
{
  "base_dir": "./fastlane/metadata/android/en-US",
  "background": "./fastlane/metadata/android/en-US/background.png",
  "title_font": "/System/Library/Fonts/SFCompact.ttf",
  "keyword_font": "/System/Library/Fonts/SFCompact.ttf",
  "title_color": "#ffffff",
  "keyword_color": "#c8c8c8",
  "device_radius_phone": 80,
  "device_radius_seven_inch": 70,
  "device_radius_tablet": 60,
  "shadow_radius": 50,
  "shadow_opacity": 150,
  "screenshot_scale": 0.70,
  "exclude_files": ["01_dashboard.png", "raw_marketing.png"],
  "fallback_title": "Upnext",
  "default_disclaimer": "TV SHOW METADATA PROVIDED BY TVMAZE.COM"
}
```

### Configuration Options
- **`screenshot_scale`**: Defines how large the device will appear relative to the background canvas height (e.g., `0.70` means 70% of the canvas height).
- **`exclude_files`**: An array of substrings. Any raw screenshot containing these strings in its filename will be skipped.
- **`device_radius_*`**: Defines the corner roundness depending on whether the detected screenshot belongs to a phone, 7-inch tablet, or 10-inch tablet.

Then run the tool from your terminal:

```bash
screenshot-framer --config framer_config.json
```

## How It Works

1. **Discovery**: The script intelligently scans the `base_dir` and common fastlane subdirectories (`phoneScreenshots`, `sevenInchScreenshots`, `tenInchScreenshots`).
2. **Device Detection**: It determines the device type (Phone, 7-inch Tablet, 10-inch Tablet) based on the containing folder or the filename (perfect for iOS devices like `iPad Pro`).
3. **Matching**: It maps your raw screenshots to the translated strings in `title.strings`.
4. **Compositing**: It scales your background, frames your screenshot with rounded corners, adds a premium drop shadow, and responsively fits your Title and Keyword text.
5. **Export**: It outputs `_framed.png` files ready for the App Store and Google Play.
