cyco.sh is a fun and handy bash script for macOS, designed to simplify the process of compressing images.
cyco.sh | ||
README.md |
cyco.sh - Cyber Compressor
cyco.sh
is a fun and handy bash script for macOS, designed to simplify the process of compressing images. Whether you’re shrinking a whole folder or just a single file, this script uses ImageMagick to get the job done efficiently. It's perfect for compressing images before sharing them on the fediverse!
Features
- Compress Images: Works with JPEG and PNG files, either in a folder or as a single file.
- Quality Control: Choose a compression quality between 1 and 100.
- Flexible Input: Use the command line interface (CLI) mode or selection dialog for file/folder input.
- Batch or Single Image: Easily switch between compressing an entire folder or a single image via command line arguments or interactive input.
Prerequisites
- ImageMagick: Ensure this tool is installed since
cyco.sh
depends on it. The script will guide you to install it using Homebrew if it’s not present.
Installation
- Install Homebrew (if you haven't already):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install ImageMagick:
brew install imagemagick
Usage
- Run the Script: Open the terminal and execute:
./cyco.sh
Ensure the script is executable with chmod +x cyco.sh
if needed.
- Command Line Arguments:
--cli
: Enables CLI mode for input.--f <folder_path>
: Path to the folder containing images.--i <file_path>
: Path to a single image file.--quality <value>
: Compression quality from 1 to 100.
Example with CLI arguments:
./cyco.sh --cli --f "/" --quality 75
- Interactive Input (if not using CLI arguments):
- Choose between compressing a folder or a single image.
- Enter the path or select via dialog.
- Enter the desired quality level (1-100).
What
- macOS Only: This script is specifically tailored for macOS environments.
- For Fun: Originally developed just for fun to compress images before sharing on the fediverse!
- Why Not Just Use ImageMagick?: While ImageMagick on its own is fully capable of handling image compression,
cyco.sh
was created to provide a lazy method to streamline the process, saving you from entering numerous ImageMagick commands.