Image Converter PHP is a lightweight and efficient PHP script for converting images between multiple formats, including PNG, JPEG, GIF, and BMP. This tool is designed to simplify image conversion tasks while maintaining high performance and easy integration.
- Multi-format Conversion: Supports conversion between PNG, JPEG, GIF, and BMP formats.
- Lightweight and Fast: Written in PHP for quick processing.
- Easy Integration: Straightforward to use in your projects.
- Customizable: Easily extendable to include more features.
- PHP 7.4 or later
- GD Library: Make sure the PHP GD extension is installed and enabled.
-
Clone this repository to your local machine:
git clone https://github.com/marwan-ahmed-23/image-converte-php.git
-
Ensure your server meets the requirements:
- PHP 7.4 or later
- GD Library enabled in your PHP configuration (
php.ini
).
-
Place the project files in your desired directory on your web server.
-
Access the script through your preferred development environment or web server.
-
Use the following example code to convert an image:
require_once 'converter.php'; // Path to the input image $inputPath = 'path/to/your/input/image.png'; // Desired output format $outputFormat = 'jpeg'; // Options: png, jpeg, gif, bmp // Output path for the converted image $outputPath = 'path/to/output/image.jpeg'; // Convert the image if (convertImage($inputPath, $outputFormat, $outputPath)) { echo "Image successfully converted to $outputFormat!"; } else { echo "Image conversion failed."; }
image-converte-php/
├── public/
│ └── index.php
├── examples/
│ └── example.php
├── LICENSE
├── .gitignore
└── README.md
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.
If you found this project helpful, please consider giving it a ⭐ on GitHub. Your support means the world to us!