Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lostjared/image_convert20
Image Conversion Tool written in C++20
https://github.com/lostjared/image_convert20
cpp20 file-format image-conversion opencv
Last synced: 9 days ago
JSON representation
Image Conversion Tool written in C++20
- Host: GitHub
- URL: https://github.com/lostjared/image_convert20
- Owner: lostjared
- License: gpl-3.0
- Created: 2024-03-31T07:30:51.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-01T21:30:28.000Z (8 months ago)
- Last Synced: 2024-04-02T08:29:04.977Z (8 months ago)
- Topics: cpp20, file-format, image-conversion, opencv
- Language: C++
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Image File Conversion/Resize Tool
This tool is designed for converting and resizing image files. It leverages the power of OpenCV to handle various image operations efficiently. This utility allows for batch processing of images, resizing based on specified dimensions, and supports multiple input and output formats.
## Motivation
To quickly and easily convert between formats and resolutions with a terminal program. Also to mass convert and resize large amounts of files.## Features
- Convert image files between different formats.
- Resize images to specified dimensions.
- Batch processing of multiple images.
- Command-line interface for easy scripting and automation.## Requirements
- C++ compiler with C++20 support.
- OpenCV library installed.## Installation
To use this tool, you must have OpenCV installed on your system. After ensuring OpenCV is set up, follow these steps:
1. Clone this repository or download the source code.
2. Compile the source code using a C++ compiler, ensuring the OpenCV library is correctly linked. For example:```bash
make -f Makefile.ux
sudo make install```
or
```bash
mkdir build && cd build
cmake ..
make -j6
sudo make install```
## Usage
The tool is used through the command line, with several options available for specifying input and output parameters.
```
Usage: image_convert [options]Options:
-i, --input file Specify an input file list.
-f, --image file input Specify a single image file for input.
-o, --output file format Specify the output file format (e.g., jpg, png).
-s, --scale resolution Specify the scale resolution in the format WidthxHeight (e.g., 800x600).
-I, --input Alternative way to specify an input file.
-O, --output Alternative way to specify output format.
-S, --size Alternative way to specify scale resolution.
-F, --file Alternative way to specify a single image file input.
```### Examples
- Convert a single image to JPG format:
```bash
./image_convert -f image.png -o jpg
```- Resize and convert an image to PNG format:
```bash
./image_convert -f image.jpg -s 1024x768 -o png
```- Process multiple images listed in a file:
```bash
./image_convert -i input_list.txt -o png
```Each line in `input_list.txt` should contain the path to an individual image file.
## How It Works
The tool reads the command-line arguments to determine the operation mode, input files, output format, and dimensions for resizing. It then processes each input image according to the specified options, performing conversion and/or resizing as needed, and saves the result to the specified output format.
Note: Ensure that the dimensions for resizing are positive integers, and the output format is supported by OpenCV.