Download the PHP package sylvainjule/colorextractor without Composer

On this page you can find all versions of the php package sylvainjule/colorextractor. 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 colorextractor

Kirby – Color extractor

colorextractor

This plugins extracts a dominant / average color of any image and stores it in the file's metadata as a HEX value. Optionally, it can also generate a color palette to be used in combination with the color field.


Overview

This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, you can consider making a donation of your choice.


1. Installation

Compatible with Kirby 5 (latest release) as well as Kirby 3 and 4 (maintained / tested up to v2.0.0 of this plugin).

Download and copy this repository to

Alternatively, you can install it with composer:


2. Default usage

It can be used in two ways :

2.1. Hook

Once installed within the folder, it will automatically start extracting colors for any image uploaded or replaced in the panel.

2.2. Panel button

If you happen to upload files manually, from frontend or any other way while not trigerring the hooks, custom janitor jobs are also available to catch up with all the images of a website without an associated color.

You'll first need to install the janitor plugin and the Kirby CLI:

Then use the jobs in your blueprints:

The extractColors job will only extract the missing colors. If you want to force a re-extraction of existing colors, use the forceExtractColors job instead.


3. Default options

3.1. Extraction mode

By default, the plugin tends to extract the most dominant / vibrant color of the image. Sometimes though, it can be handy to extract an average one based on an approximation of the whole color palette. When set to average, this options shrinks the image to a 1x1 pixel thumb, then grab the color the image processor chose as the average one. You'll find some examples here.

You can also set it to both, if you want both colors to be extracted and pick from them later from your templates (see the )

Available options are dominant | average | both. Default is dominant.

3.2. Transparency handling

The plugin needs to know how to handle colors with alpha value greater than zero, and what color to fallback to when transparency is detected.

Default is


4. Displaying and using the color

4.1. If a single color is extracted

In case you have chosen either dominant (default) or average extraction mode, you can access it directly from your template under the color fieldname:

The plugin works well combined with @hananils's color picker, which might come handy to preview and adjust the detected color.

4.2. If both colors are extracted

If you have chosen to extract and store both colors, the color field will store both HEX values delimited by a comma. The plugin provides a file method to get a specific color from there:


5. Palette usage

palette

You have two options to generate the palette:

5.1. Hook

You can generate a palette for any image uploaded or replaced in the panel. In order to to so, you need to set the palette.hook option to true (default if false).

Additionally, you can:

The palette will be stored in the file .txt with the fieldname: palette. The plugin provides a dedicated field methods to use is, see below.

If you only need this plugin to extract palettes, you can also disable the default average / dominant color extraction hook with the default.hook option (default is true):

5.2. Field method

If you don't want any hook running, you can also choose not to activate the hook but use the ->getPalette() method.

You can use is to populate the color field options, for example:


6. License

MIT


7. Credits


All versions of colorextractor with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.1
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 sylvainjule/colorextractor contains the following files

Loading the files please wait ....