Metadata-Version: 2.1
Name: image_format_converter
Version: 0.1.1
Summary: A lightweight Python package that converts images in a directory from one format to another while preserving their dimensions.
Home-page: https://github.com/0xCaponte/image_format_converter
Author: Carlos Aponte
Author-email: carlos@caponte.io
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: Pillow
Description-Content-Type: text/markdown

# Image Format Converter

A lightweight Python package that converts images in a directory from one format to another while preserving their dimensions.

**Features:**
- Convert images from one format (e.g., JPEG) to another (e.g., PNG).
-  Option to save the converted images in a different directory.
-  Option for recursive conversion in subdirectories.
-  Option to overwrite the original images with the converted ones.

## Installation

To install the Image Format Converter, use pip:

```
pip install image-format-converter
```

## Usage

After installing the package, you can use it from the command line:

```
image-format-converter -d DIRECTORY -i INPUT_FORMAT -o OUTPUT_FORMAT [OPTIONS]
```
### Parameters

    -d, --directory: Path of the directory containing images to be converted.
    -i, --input_format: Input image format (e.g., jpeg, png).
    -o, --output_format: Output image format (e.g., png, bmp).
    -od, --output_directory: Directory to save the converted images. If not specified, images will be saved in the input directory.
    -r, --recursive: Use this flag to process files in subdirectories too.
    --overwrite: Use this flag to overwrite the original image with the converted one.

## Examples

#### Basic Conversion:

Convert all JPEG images in the `images/` directory to PNG.

```
image-format-converter -d images/ -i jpeg -o png
```

#### Saving to a Different Directory:

Convert all JPEG images in the `images/` directory to PNG and save them in `converted/` directory.

```
image-format-converter -d images/ -i jpeg -o png -od converted/
```

#### Recursive Conversion:

Convert all JPEG images in the `images/` directory and its subdirectories to PNG.

```
image-format-converter -d images/ -i jpeg -o png -r
```

#### Overwriting Original Images:

Convert all JPEG images in the `images/` directory to PNG and replace the original JPEGs.

```
image-format-converter -d images/ -i jpeg -o png --overwrite
```

## License

This project is open-source and available under the MIT License.


