Skip to content

johnbrodowski/BulkImageConverter2.0

Repository files navigation

Bulk Image Converter

A powerful command-line tool for converting image formats in bulk with watermarking capabilities. Built with .NET 6 and ImageMagick.

Features

  • Single Image Conversion: Convert individual images to different formats
  • Batch Conversion: Convert multiple images from a directory at once
  • Watermarking: Add text or image watermarks to your converted images
  • Subdirectory Support: Process images in nested folder structures
  • Flexible Naming: Option to rename files based on folder names
  • Multiple Formats: Support for webp, png, bmp, tif, gif, jpg, and jpeg formats
  • Safe Deletion: Optional deletion of original files with confirmation prompts

Requirements

  • .NET 6.0 SDK or later
  • ImageMagick (automatically included via Magick.NET)

Installation

  1. Clone this repository:
git clone https://github.com/yourusername/BulkImageConverter2.0.git
cd BulkImageConverter2.0
  1. Build the project:
dotnet build
  1. Run the application:
dotnet run

Usage

Main Menu

When you start the application, you'll see:

============================================
         Welcome to Image Converter
============================================

Main Menu:
1. Convert a single image.
2. Convert multiple images from a directory.
Type '/help' for instructions or '/exit' to quit.

Single Image Conversion

  1. Select option 1 from the main menu
  2. Enter the path to your image (or drag and drop the file)
  3. Choose target format (webp, png, bmp, tif, gif, jpg, jpeg)
  4. Optionally add a watermark (text or image)
  5. Choose whether to delete the original file

Batch Conversion

  1. Select option 2 from the main menu
  2. Enter the directory path (or drag and drop the folder)
  3. Choose watermark type and add if desired
  4. Decide whether to include subdirectories
  5. Choose if files should be renamed based on folder names
  6. Select source and target image formats
  7. Choose whether to delete original files

Watermarking Options

When adding watermarks, you can choose:

  • Text Watermark: Enter any text to overlay on the image
  • Image Watermark: Provide path to a watermark image file
    • Position options: Top, Middle, or Bottom

Examples

Convert a single PNG to WEBP

Enter your choice: 1
Enter the path of the file: /path/to/image.png
Enter the target image type: webp
Add watermark? (yes/no): no
Delete original file after conversion? (yes/no): no

Batch convert all JPEGs to PNG with watermark

Enter your choice: 2
Enter the directory path: /path/to/images
Choose watermark type (1: text, 2: image): 1
Add watermark? (yes/no): yes
Enter the watermark path or text: Copyright 2024
Include subdirectories? (yes/no): yes
Rename files based on folder name? (yes/no): no
Enter the source image type: jpg
Enter the target image type: png
Delete original files after conversion? (yes/no): no

Building from Source

# Clone the repository
git clone https://github.com/yourusername/BulkImageConverter2.0.git

# Navigate to the project directory
cd BulkImageConverter2.0

# Restore dependencies
dotnet restore

# Build the project
dotnet build -c Release

# Run the application
dotnet run

Dependencies

  • Magick.NET-Q16-AnyCPU: ImageMagick library for .NET
  • Magick.NET.Core: Core ImageMagick functionality

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support

If you encounter any issues or have questions, please open an issue on GitHub.

About

A powerful command-line tool for converting image formats in bulk with watermarking capabilities. Built with .NET 6 and ImageMagick.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages