Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/robyfirnandoyusuf/image-compressor

Easily compress images using PHP
https://github.com/robyfirnandoyusuf/image-compressor

Last synced: 4 days ago
JSON representation

Easily compress images using PHP

Awesome Lists containing this project

README

        

# PHP ImageCompressor
[![Issues](https://img.shields.io/github/issues/robyfirnandoyusuf/Image-Compressor)](https://github.com/robyfirnandoyusuf/Image-Compressor/releases)
[![Starts](https://img.shields.io/github/stars/robyfirnandoyusuf/Image-Compressor)](https://github.com/robyfirnandoyusuf/Image-Compressor/releases)
[![Total Downloads](https://img.shields.io/packagist/dt/robyfirnandoyusuf/Image-Compressor.svg)](https://packagist.org/packages/robyfirnandoyusuf/image-compressor)
[![LICENSE](https://img.shields.io/github/license/robyfirnandoyusuf/Image-Compressor)](LICENSE)

A PHP Package to Compress Image.

## Requirements
PHP cURL Module Enable

## Installation

You can install the package via composer:

```bash
composer require robyfirnandoyusuf/image-compressor
```
## Usage
```php
use ImageCompressor\ImageCompressor;
ImageCompressor::compress('x.jpg','good','/path/output');
```

**parameter 1** : filename.jpg / .png

**parameter 2** : quality (normal,good,high,extreme)

**parameter 3** : output directory

###### Compression details at different levels.



Compression Mode
jpg
png


mozjpeg
pngquant




normal (Less compression, better image quality)
quality 85
speed 3


good **Recommended** (Balanced compression & image quality)
quality 80
speed 1


high (More compression & less image quality)
quality 70
speed 1


extreme **Not Recommended**(Most compression & lowest image quality)
quality 60
speed 1

## Tested On

OS : Ubuntu 16.04 LTS

PHP Version : PHP 7.3.3

Web Server : Apache2

## Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Version

**Current version is 1.0.0** and still development.

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.

## Contact
If you meet any problem when using ImageCompressor, file a issue or contact me directly.
[Roby Firnando Yusuf](https://facebook.com/exploreourbrain)