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.
- 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.
- C++ Compiler with C++17 support (e.g., GCC, Clang, MSVC)
- The program depends on
stb_image.h,stb_image_write.hfor image loading, and writing.
-featherwidth N: Sets the width of the feathering effect toNpixels. If not specified, a default value of 2 is used.
To run the program, compile it with your C++ compiler, and execute it with the required parameters.
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.
Processed images are saved in an output directory created within the current directory. Each processed image retains its original filename.