Skip to content

About

Command line tool to reduce file size of PNG images

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PngCompressor

Command line, static executable to reduce file size of PNG images with minimal quality loss, written in Zig language. Perfect for forum sites that impose upload size limitations.

Dependencies

  • zig-clap
  • lodepng (C variant)
  • libimagequant (2.x branch)

How to Build

  1. Clone the repository to your machine.
git clone https://github.com/GrainyTV/PngCompressor.git
  1. Navigate to the repository.
cd PngCompressor
  1. Compile the project by specifying the target CPU architecture and operating system. For example on a 64-bit Linux system you would use the following:
zig build -Dtarget=x86_64-linux-musl -Doptimize=ReleaseFast

Usage

To compress a single PNG file:

./PngCompressor -i input.png -o output.png

To compress all PNG files in a folder, in-place:

./PngCompressor -i ./my_folder --force

Note that you can also use absolute paths instead of relative ones if you prefer those.

Example Screenshots

The images below demonstrate the quality of image compression achieved by PngCompressor. The left image shows the original, and the right image shows the compressed version. Not really noticeable unless you look very closely.

Original Image Compressed Image
2.1 MiB 701.1 KiB
1449.3 KiB reduction (≈ 67.40% smaller)
577.8 KiB 178 KiB
399.8 KiB reduction (≈ 69.19% smaller)
387.1 KiB 228.3 KiB
158.8 KiB reduction (≈ 41.02% smaller)

Contribution

I welcome contributions from anyone. If you have any observations, bug reports, or suggestions for improvements, please create issues or pull requests on this repository.

License

PngCompressor is released under the MIT License. You are free to use, modify, and distribute the code in accordance with the terms of the license. See the LICENSE file for more details.

About

Command line tool to reduce file size of PNG images

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages