Download & Install

A cropped image.

A cropped image.

There are mainly two ways of using CImage. You either install the whole project which uses the autoloader to include needed files, or you install the all-included bundle that – for convenience and ease of use – contains all code in one script.

You can download CImage from GitHub or by using composer.

If this is your first time then I would recommend downloading the whole repo from GitHub. That is the fastest and easiest way of getting up and running for the first time.


A small version of the original image.

A small version of the original image.

The source code is available on GitHub. Clone, fork or download as zip.

You can clone it like this.

git clone git://
cd cimage

Ensure that the cache-directory is writable by the webserver.

chmod 777 cache

Point your web browser to webroot/test/test.php to see some examples.

Then try on your own by using the script img.php. Try the following url:


It should display the same image as to above right.


The package mos/cimage is available on Packagist and you can install it using composer.

composer require mos/cimage

You can now copy the all-included bundles from the webroot directory and put them in your own web root directory, or you copy img.php together with its config file img_config.php and you put it in your own web root.

#All-included bundle

There exists pre-configured variants of the all-included bundles of img.php. These can be downloaded as a single PHP script and used without dependency to the rest of the source code.

Bundled script Description
imgd.php Development mode
imgp.php Production mode
imgs.php Strict mode

Download the bundle of your choice from the links above or by using wget or curl like this.

curl -O