Metadata-Version: 2.4
Name: photoscaler
Version: 1.0.6
Summary: Professional Image and Video Scaling Library with Subprocess Support
Author: Developer
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: Pillow
Requires-Dist: opencv-python
Requires-Dist: numpy
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# PhotoScaler 🚀 (v1.0.6)

**PhotoScaler** is a professional-grade media processing library for Python. It provides high-fidelity upscaling/downscaling for both images and videos, featuring **automatic audio preservation**, **batch processing**, and **advanced sharpening filters**.

---

## ✨ Key Features

* **Audio Sync:** Automatically extracts and merges original audio back into scaled videos using FFmpeg.
* **Smart Scaling:** Uses `LANCZOS4` interpolation for superior detail reconstruction.
* **Visual Enhancement:** Integrated sharpening kernels to restore clarity after scaling.
* **Batch Processing:** Process entire directories of images or videos by passing a folder path.
* **Aspect Ratio Guard:** Optional `keep_ratio` setting to prevent image stretching or squashing.
* **Animation Support:** Full support for animated GIFs, preserving frame sequences and timing.
* **Case-Insensitive API:** Flexible parameter handling (e.g., `SeeProcess` or `seeprocess`).

---

## 🛠 Prerequisites

To use the video audio features, **FFmpeg** must be installed on your system.
* **Windows:** Download from [gyan.dev](https://www.gyan.dev/ffmpeg/builds/) and add to your PATH.

---

## 📦 Installation

For Users (PyPI)Bashpip install photoscaler
🚀 Usage Guide1. High-End Video UpscalingScale a video to 4K while keeping the audio and adding sharpness.Pythonfrom photoscaler import scaler

scaler(
    file=r"C:\Media\input.mp4", 
    mode="upscale", 
    resolution="3840x2160",
    output=r"C:\Exports",
    SeeProcess=True,    # Live terminal progress bar
    sharpness=True,     # Apply sharpening filter
    keep_ratio=True,    # Maintain original proportions
    quality=100         # Maximum output quality
)
2. Batch Processing (Folders)Process every image or video in a folder to a specific width automatically.Pythonfrom photoscaler import scaler

# Processes all supported files in the directory
scaler(
    file=r"C:\Photos\Album", 
    mode="upscale", 
    resolution="1920",  # Auto-calculates height
    SeeProcess=True,
    sharpness=True
)
3. Format Conversion & Quality ControlDownscale and convert a PNG to a high-quality WebP.Pythonfrom photoscaler import scaler

scaler(
    file="logo.png",
    mode="downscale",
    resolution="500x500",
    OutputType="webp",
    quality=90
)

🛠 Parameters

file	str	Path to a file or a directory for batch mode.	Required

mode	str	Operation mode (upscale or downscale).	Required

resolution	str	Target size (e.g., "1920x1080" or "1920").	Required

output	str	Directory where the output will be saved.	Original Dir

OutputFileName	str	Custom name for the output file.	scaled_...

OutputType	str	Change output format (e.g., "png", "mp4").	Original

SeeProcess	bool	Enables a real-time progress bar.	False

sharpness	bool	Applies a 3x3 sharpening kernel.	False

keep_ratio	bool	Locks the aspect ratio.	False

quality	int	Output compression quality (1-100).	95

use_gpu	bool	Enables CUDA acceleration.	False
