Download the PHP package amirrezam75/image-optimizer without Composer

On this page you can find all versions of the php package amirrezam75/image-optimizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package image-optimizer

Installation

Usage

You may change output location by changing first argument.

It uses gifsicle as default optimizer; if you need to use another command line utility to optimize your images just write your own optimizer and pass as second argument.

An optimizer is any class that implements the AmirRezaM75\ImageOptimizer\Optimizer interface.

If you wish to convert it to webm:

It uses ffmpeg as default converter. If you need to use another command line utility to convert your file; create a class that implements AmirRezaM75\ImageOptimizer\Converter interface.

Optimization tools

Gifsicle

Options

--batch, -b Modify each GIF input in place by reading and writing to the same filename. (GIFs read from the standard input are written to the standard output.)

-O[level], --optimize[=level] Optimize output GIF animations for space. Level determines how much optimization is done; higher levels take longer, but may have better results.

--lossy[=lossiness] Alter image colors to shrink output file size at the cost of artifacts and noise. Lossiness determines how many artifacts are allowed; higher values can result in smaller file sizes, but cause more artifacts. The default lossiness is 20.

-k[=num], --colors[=num] Reduce the number of distinct colors in each output GIF to num or less. Num must be between 2 and 256. This can be used to shrink output GIFs or eliminate any local color tables.

-o [file], --output [file] Send output to file. The special filename ‘-’ means the standard output.

--color-method [method] Determine how a smaller colormap is chosen.

Installation

In order to compress gif files, you need to install Gifsicle v1.92+

git clone https://github.com/kohler/gifsicle

apt install automake make gcc build-essential

./bootstrap.sh or autoreconf -i

./configure

make

make install

Converter tools

FFMPEG

Options

-i Specifies the input file

-r[:stream_specifier] Set frame rate (Hz value, fraction or abbreviation).

-c[:stream_specifier] codec or -codec Select an encoder or a decoder for one or more streams.

libvpx-vp9 is the VP9 video encoder for WebM

-crf Sets CRF value. Must be from 4-63 in VP8, or 0-63 in VP9. Lower is higher quality. 10 the recommended setting. There are two ways of using CRF.

-b:v is the maximum allowed bitrate. Higher means better quality. Only use this option if you desire a constant bitrate, which will produce a higher quality file. If you are looking for a smaller file size, consider leaving this out

-an Disable audio.

-qmin, -qmax: Tells ffmpeg what "quantization parameter" to use when assigning quality. Don't worry if you don't know what a quantization parameter is, because neither do I. All I know is that lower numbers = better quality. I believe the -qmax option prevents the quality from dropping below a certain level for any given frame, so the overall video quality will be more consistent (it prevents you from getting certain frames in your video which are of absolutely dreadful quality where everything is blocky as fuck, basically).

-qmin – the minimum quantizer (default 4, range 0–63)

-qmax – the maximum quantizer (default 63, range qmin–63)

-vsync parameter Video sync method. For compatibility reasons old values can be specified as numbers. Newly added values will have to be specified as strings always.

This option is necessary if you wanna fix disposal asis delay on last frame issue

Installation

Install the latest version of ffmpeg.

sudo add-apt-repository ppa:savoury1/ffmpeg4

We need v4+ since it uses libavcodec 58. 91.100 encoder, and that's what we need

sudo apt-get update

sudo apt-get install ffmpeg

sudo apt-get install libvpx5

Duo to file location permission, I recommend to don't install it via snap


All versions of image-optimizer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
ext-fileinfo Version *
symfony/process Version ^4.2|^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amirrezam75/image-optimizer contains the following files

Loading the files please wait ....