Metadata-Version: 2.4
Name: png2jpg
Version: 0.1.0
Summary: A Python package to convert PNG images to JPG format while maintaining directory structure
Author-email: Tuan Anh Bui <bta1489@gmail.com>
Maintainer-email: Tuan Anh Bui <bta1489@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/tuananhbui89/png2jpg
Project-URL: Repository, https://github.com/tuananhbui89/png2jpg.git
Project-URL: Documentation, https://github.com/tuananhbui89/png2jpg#readme
Project-URL: Bug Tracker, https://github.com/tuananhbui89/png2jpg/issues
Keywords: png,jpg,jpeg,image,conversion,converter
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Pillow>=8.0.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Dynamic: license-file

# png2jpg

A Python package to convert PNG images to JPG format while maintaining directory structure and optimizing file sizes.

## Installation

You can install the package using pip:

```bash
pip install png2jpg
```

## Usage

The package provides a command-line interface to convert PNG images to JPG format. Here's how to use it:

### Basic Usage

```bash
png2jpg -d /path/to/png/directory -o /path/to/output/directory
```

### Alternative Usage

You can also run the package as a Python module:

```bash
python -m png2jpg -d /path/to/png/directory -o /path/to/output/directory
```

### Command Line Arguments

- `-d, --directory`: (Required) The root directory containing PNG files to convert
- `-o, --output`: (Optional) The output directory for JPG files (default: 'lower')
- `-q, --quality`: (Optional) JPG quality (0-100, default: 50)
- `-l, --lowest`: (Optional) Minimum file size in MB to apply quality reduction (default: 0.5)
- `-v, --verbose`: (Optional) Enable verbose output

### Examples

1. Convert all PNG files in a directory with default settings:
```bash
png2jpg -d ./images
```

2. Convert with custom quality and minimum file size:
```bash
png2jpg -d ./images -q 80 -l 1.0
```

3. Convert with verbose output:
```bash
png2jpg -d ./images -v
```

4. Convert with custom output directory:
```bash
png2jpg -d ./images -o ./converted_images
```

## Features

- Maintains original directory structure
- Automatically creates output directories
- Preserves full quality for small files (below the minimum size threshold)
- Configurable JPG quality
- Verbose mode for detailed conversion information

## Requirements

- Python 3.8+
- Pillow (PIL Fork) >= 8.0.0

## License

MIT License
