Skip to content

A high-performance, feature-rich image conversion CLI tool built in Go. Fast. Smart. Efficient. All from the terminal.

License

Notifications You must be signed in to change notification settings

MostafaSensei106/GoPix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GoPix

GoPix Banner

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 and powered by libvips for extreme performance. 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

  • High-Performance Engine: Powered by libvips for 4-8x faster conversions and lower memory usage.
  • Extensive Format Support: PNG, JPG, WEBP, TIFF, GIF, AVIF, HEIF.
  • Parallel Processing: Uses all CPU cores for maximum speed.
  • Real-time Progress Bar: Track progress with count, ETA, and throughput.
  • Smart Resume: Automatically resume interrupted conversion sessions.

πŸ› οΈ Advanced Capabilities

  • Metadata Control: Keep or strip EXIF data to reduce file size or protect privacy.
  • 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.
  • Quality and Sizing:
    • Custom output quality (1-100).
    • Set max width/height for automatic resizing.
  • Dry-Run Mode: Preview all changes without writing any files.
  • Backup Originals: Automatically back up original files before converting.
  • Rate Limiting: Limit operations per second to prevent system overload.
  • Detailed Reporting: Get a full statistical report after each session.

πŸ›‘οΈ Security & Reliability

  • Path Validation: Prevents directory traversal attacks.
  • Permission Checking: Ensures files and directories are accessible.
  • Disk Space Validation: Checks for sufficient disk space before starting.

Installation

⚠️ IMPORTANT: New Dependency

GoPix v2.0 and later uses libvips for image processing. You must have libvips installed on your system for GoPix to work.

πŸ”§ Installing libvips

  • On macOS:
    brew install vips
  • On Debian/Ubuntu:
    sudo apt install libvips-dev
  • On Fedora:
    sudo dnf install vips-devel
  • On Windows:
    1. Download the latest vips-dev-w64-all-x.y.z.zip from the libvips releases page.
    2. Extract it to a location like C:\vips-dev.
    3. Add the C:\vips-dev\bin directory to your system's PATH.

πŸ“¦ Easy Install (Linux / Windows)

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

Then you can test the tool by running:

gopix -v

πŸͺŸ Windows

  1. Download gopix-windows-amd64-vX.Y.Z.zip from the Releases page.
  2. Extract the archive to a folder of your choice.
  3. Add that folder to your System PATH.

Then you can test the tool by running:

gopix -v

πŸ—οΈ Build from Source

Ensure you have Go, git, make, and libvips installed first.

git clone --depth 1 https://github.com/MostafaSensei106/GoPix.git
cd GoPix
make

This will compile and install GoPix locally.


πŸ†™ Upgrading

To upgrade GoPix to the latest version, simply run:

gopix upgrade

πŸš€ Quick Start

# Convert all images in a directory to high-quality AVIF
gopix -p ./images -t avif -q 90
# Convert to JPEG, strip metadata, and keep originals
gopix -p ./images -t jpg --metadata strip --keep

πŸ“‹ Usage Examples

πŸ” Basic Conversion

# Convert to WebP with 95% quality
gopix -p ./photos -t webp -q 95

βš™οΈ Metadata Control

# Convert to PNG and remove all EXIF data
gopix -p ./photos -t png --metadata strip

πŸ”„ Advanced Batch Processing

# Process all images recursively and save to a different directory
gopix -p ./source_images -t webp --output-dir ./converted_images --recursive

Configuration

GoPix uses a YAML config file located at ~/.gopix/config.yaml on Linux/macOS and %USERPROFILE%\.gopix\config.yaml on Windows.

🧾 Example Config:

default_format: "avif"
quality: 90
workers: 8
max_dimension: 4096
log_level: "info"
metadata: "keep" # Can be: keep, strip
auto_backup: false
resume_enabled: true

# Batch processing configuration
batch_processing:
  recursive_search: true
  max_depth: 0
  preserve_structure: true
  output_dir: ""
  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
πŸš€ Govips davidbyttow/govips β€” High-performance image processing via libvips
πŸ› οΈ Cobra (CLI) spf13/cobra β€” CLI commands, flags, and UX
🎨 Fatih/color fatih/color β€” Terminal text styling and coloring
πŸ“‰ 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:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/YourFeature
  3. Commit your changes: git commit -m "Add amazing feature"
  4. Push to your branch: git push origin feature/YourFeature
  5. Open a pull request.

πŸ’‘ Please read our Contributing Guidelines and 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

About

A high-performance, feature-rich image conversion CLI tool built in Go. Fast. Smart. Efficient. All from the terminal.

Topics

Resources

License

Contributing

Stars

Watchers

Forks