Skip to content

CoinOPS-Official/AlphaIfier

Repository files navigation

AlphaIfier

Overview

AlphaIfier is a C++ program designed to apply an alpha feathering effect to PNG images. The program adjusts the transparency of the pixels around the edges of an image, creating a smooth transition from transparent to opaque. This is particularly useful for blending images into different backgrounds smoothly.

Features

  • Alpha Feathering: Applies a feathering effect to the edges of images.
  • Batch Processing: Can process multiple images in a folder, ensuring they all have the same dimensions.
  • Dimension Verification: Checks and logs any images with dimensions that do not match the first found image when processing a directory.

Requirements

  • C++ Compiler with C++17 support (e.g., GCC, Clang, MSVC)
  • The program depends on stb_image.h, stb_image_write.h for image loading, and writing.

Usage

Command Line Arguments

  • -featherwidth N: Sets the width of the feathering effect to N pixels. If not specified, a default value of 2 is used.

Running the Program

To run the program, compile it with your C++ compiler, and execute it with the required parameters.

Example Commands

AlphaIfier -featherwidth 10 path/to/image.png

This command will process an image named image.png, applying an alpha feathering effect with a width of 10 pixels around the edges.

AlphaIfier -featherwidth 5 path/to/directory

This command will process all PNG images within the specified directory, applying a 5-pixel-wide feathering effect. All images must have the same dimensions; otherwise, images with differing dimensions will be reported and not processed.

Output

Processed images are saved in an output directory created within the current directory. Each processed image retains its original filename.

Batch Processing

About

Takes a png or folder full of pngs and applies a feathere alpha channel border

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published