2 stable releases
1.1.0 | Nov 1, 2024 |
---|---|
1.0.0 | Oct 28, 2024 |
#142 in Images
12KB
125 lines
logo
A command-line tool for overlaying logos on images with precise control over size and position.
Features
- Add a logo to any image
- Control logo size as a percentage of the base image
- Choose logo position (top-right, top-left, bottom-right, bottom-left)
- Maintains logo aspect ratio
- Supports various image formats (PNG, JPEG, etc.)
Installation
Using Cargo (Recommended)
If you have Rust installed, you can install directly from crates.io:
cargo install ku-logo
Manual Installation
- Download the latest release for your platform from the releases page
- Extract the archive
- Add the binary to your PATH
For development setup, see the Development Setup section.
Development Setup
To set up the development environment, we use devenv.sh. This ensures a consistent development experience across different platforms.
-
Install
devenv
following the instructions at devenv.sh/getting-started -
Clone the repository:
git clone https://github.com/kualta/logo.git cd logo
-
Initialize the development environment:
devenv init
-
Enter the development shell:
devenv shell
This will set up all required dependencies, including:
- Rust toolchain and cargo
- Cross-compilation tools
- Required system libraries
Available Scripts
hello
- Test the development environmentbuild-linux
- Build release binary for Linux
Run scripts using:
devenv run <script-name>
Usage
# Basic usage with default settings (5% size, top-right position)
logo -i input.png -l logo.png -o output.png
# Specify size and position
logo -i input.png -l logo.png -p 10 --position bottom-left -o output.png
# Show help
logo --help
Options
-i, --image <PATH>
- Path to the base image-l, --logo <PATH>
- Path to the logo image-p, --percentage <NUMBER>
- Logo size as percentage (default: 5%)--position <POSITION>
- Logo position (top-right, top-left, bottom-right, bottom-left)-o, --output <PATH>
- Output path for the resulting image
License
This project is licensed under the MIT License - see the LICENSE file for details.
Dependencies
~7MB
~100K SLoC