GoPix
A high-performance, feature-rich image conversion CLI tool built in Go.
Fast. Smart. Efficient. All from the terminal.
About β’
Features β’
Installation β’
Configuration β’
Technologies β’
Contributing β’
License
About
Welcome to GoPix β a blazing-fast image conversion CLI tool built with Go.
GoPix empowers developers, designers, and power users with efficient batch image conversions, intelligent file handling, and performance-oriented architecture. Whether youβre processing thousands of photos or optimizing a single folder, GoPix handles it with speed and precision.
Features
π Core Functionality
- Multi-format support: PNG, JPG, WebP, JPEG
- Parallel processing: Uses all CPU cores for maximum speed
- Real-time progress bar with ETA
- Smart resume for interrupted conversions
- Custom quality and compression settings
π οΈ Advanced Capabilities
- Enhanced Batch Processing: Process folders and subfolders with advanced options
- Recursive directory traversal with depth control
- Preserve or flatten directory structure
- Custom output directory support
- Group results by source folder
- Skip empty directories
- Follow symbolic links (optional)
- Size and resolution limits
- Configuration profiles with YAML support
- Dry-run mode to preview changes
- Backup of originals
- Rate limiting to prevent system overload
- Detailed post-process stats and reporting
π‘οΈ Security & Reliability
- Path validation to prevent directory traversal
- Safe defaults and permission checking
- Disk space validation before starting jobs
- Robust error handling and auto-retry mechanism
Installation
π¦ Easy Install (Linux / Windows)
[!IMPORTANT]
sudo is required for some installation commands on linux.
GoPix Only supports x86_64 architecture.
macOS will not be supported in the future.
Download the latest pre-built binary for your platform from the Releases page.
π§ Linux
Extract the archive
tar -xzf gopix-linux-amd64.vX.Y.Z.tar.gz
Move the binary to the local bin directory
sudo mv linux/amd64/gopix /usr/local/bin
If you want to install for a specific user
mv linux/amd64/gopix /home/$USER/.local/bin
Then you can test the tool by running:
gopix -v
πͺ Windows
-
Download gopix-windows-amd64-vX.Y.Z.zip from the Releases page.
-
Extract the archive to a folder of your choice.
-
Move the binary located at windows/amd64/gopix.exe to any folder of your choice or C:\Program Files\GoPix\bin.
-
Add that folder to your System PATH:
- Open System Properties β Environment Variables β Path β Edit β Add new.
Then you can test the tool by running:
gopix -v
ποΈ Build from Source (Linux, Windows)
![π Note]
GoPix uses a Makefile to build and install the CLI tool.
Make sure you have the make utility Go and git installed on your system.
The script may adjust environment-specific paths depending on your OS.
π§ Step 1: Install make (if not already installed)
For Arch Linux and based distros:
sudo pacman -S base-devel mingw-w64-gcc
For Debian / Ubuntu and based distros:
sudo apt install build-essential gcc-mingw-w64-x86-64
For Fedora and based distros:
sudo dnf install make mingw64-gcc
For openSUSE and based distros:
sudo zypper install make mingw64-gcc
For Windows:
βοΈ Step 2: Clone and Build
git clone --depth 1 https://github.com/MostafaSensei106/GoPix.git
cd GoPix
make
β
Result
- This will compile GoPix from source optmized for your os and cpu architecture and install it locally.
- The binary will be placed in your system's executable path (like
/usr/local/bin on Linux/macOS).
- You can now run:
gopix help
π Upgrading
[!Note]
To upgrade GoPix, make sure you have the required development tools installed:
go, make, and git.
To upgrade GoPix to the latest version, simply run
gopix upgrade
This will:
- Clone or update the latest source from GitHub.
- Rebuild the binary using your current platform and architecture.
- Replace the old version automatically.
OR
get the latest pre-built binary for your platform from Releases page and follow Installation Instructions.
π Quick Start
# Convert all images in a directory to PNG
gopix -p ./images -t png
# Convert to JPEG with 90% quality and keep originals
gopix -p ./images -t jpg -q 90 --keep
# Preview changes without applying them
gopix -p ./images -t webp --dry-run
π Usage Examples
π Basic Conversion
gopix -p ./photos -t webp -q 95
πΎ With Backup
gopix -p ./photos -t png --backup
βοΈ Advanced Usage
gopix -p ./photos -t jpg -w 8 --rate-limit 5
gopix -p ./photos -t png -v --log-file
π Batch Processing Examples
# Process all images recursively with structure preservation
gopix -p ./photos -t webp --recursive --preserve-structure
# Process with custom output directory
gopix -p ./photos -t png --output-dir ./converted --recursive
# Process with depth limit (only 2 levels deep)
gopix -p ./photos -t jpg --recursive --max-depth 2
# Process without preserving structure (flatten all files)
gopix -p ./photos -t webp --recursive --no-preserve-structure
# Process with grouping by folder
gopix -p ./photos -t png --recursive --group-by-folder
# Process following symbolic links
gopix -p ./photos -t jpg --recursive --follow-symlinks
Configuration
GoPix uses a YAML config file located at:
# on Linux
~/Home/$USER/.gopix/config.yaml
π§Ύ Example Config:
default_format: "png"
quality: 85
workers: 8
max_dimension: 4096
log_level: "info"
auto_backup: false
resume_enabled: true
# supported_extensions: ["jpg", "jpeg", "png", "webp"] # Do not add any formats here,
# Batch processing configuration
batch_processing:
recursive_search: true
max_depth: 0 # 0 = unlimited depth
preserve_structure: true
output_dir: "" # Custom output directory (empty = use input directory)
group_by_folder: false
skip_empty_dirs: true
follow_symlinks: false
All settings can be overridden using CLI flags.
Technologies
| Technology |
Description |
| π§ Golang |
go.dev β The core language powering GoPix: fast and efficient |
| π οΈ Cobra (CLI) |
spf13/cobra β CLI commands, flags, and UX |
| π¨ Fatih/color |
fatih/color β Terminal text styling and coloring |
| π WebP encoder |
chai2010/webp β Image conversion to/from WebP |
| π Resize |
nfnt/resize β Image resizing utilities |
| π Progress bar |
schollz/progressbar β Beautiful terminal progress bar |
| π¦ YAML config |
gopkg.in/yaml.v3 β Config file parser |
| π Logrus |
sirupsen/logrus β Advanced logging framework |
Contributing
Contributions are welcome! Hereβs how to get started:
- Fork the repository
- Create a new branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m "Add amazing feature"
- Push to your branch:
git push origin feature/YourFeature
- Open a pull request
π‘ Please open an issue first for major feature ideas or changes.
License
This project is licensed under the GPL-3.0 License.
See the LICENSE file for full details.
Made with β€οΈ by MostafaSensei106