PHPackages                             randomhost/image - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. randomhost/image

ActiveLibrary[Image &amp; Media](/categories/media)

randomhost/image
================

Encapsulates common GD library operations in PHP classes.

3.0.0(2y ago)01562BSD-3-ClausePHPPHP ~8.0

Since Sep 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/randomhost/image)[ Packagist](https://packagist.org/packages/randomhost/image)[ Docs](https://github.random-host.tv)[ RSS](/packages/randomhost-image/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (1)Versions (12)Used By (2)

[![Build Status](https://github.com/randomhost/image/actions/workflows/php.yml/badge.svg)](https://github.com/randomhost/image/actions/workflows/php.yml)

randomhost/image
================

[](#randomhostimage)

- [1. Purpose](#1-purpose)
- [2. Usage](#2-usage)
    - [2.1. The Image object](#21-the-image-object)
        - [2.1.1. Instantiation](#211-instantiation)
        - [2.1.2. Retrieving image data](#212-retrieving-image-data)
        - [2.1.3. Combining images](#213-combining-images)
        - [2.1.4. Scaling strategies](#214-scaling-strategies)
        - [2.1.5. Rendering the image](#215-rendering-the-image)
    - [2.2. The Color object](#22-the-color-object)
        - [2.2.1. Constructor](#221-constructor)
        - [2.2.2. Configuring the color](#222-configuring-the-color)
        - [2.2.3. Retrieving color data](#223-retrieving-color-data)
        - [2.2.4. Validating color data](#224-validating-color-data)
    - [2.3. The Image/Text/Generic object](#23-the-imagetextgeneric-object)
        - [2.3.1. Constructor](#231-constructor)
        - [2.3.2. Configuring the text](#232-configuring-the-text)
        - [2.3.3. Retrieving text data](#233-retrieving-text-data)
        - [2.3.4. Rendering the text](#234-rendering-the-text)
    - [2.4. The Image/Text/Decorator object family](#24-the-imagetextdecorator-object-family)
        - [2.4.1. Constructor](#241-constructor)
        - [2.4.2. Retrieving text decorator data](#242-retrieving-text-decorator-data)
        - [2.4.3. Rendering text using a decorator](#243-rendering-text-using-a-decorator)
    - [2.5. The Image/Text/Decorator/Border object](#25-the-imagetextdecoratorborder-object)
        - [2.5.1. Configuring the border](#251-configuring-the-border)
        - [2.5.2. Retrieving border data](#252-retrieving-border-data)
- [3. License](#3-license)

1. Purpose
----------

[](#1-purpose)

This package encapsulates some common GD library operations in PHP classes. It was created as part of the `randomhost/webcamoverlay` package but is released as a separate component, so it can be used in other packages.

Because it was created as a dependency of the `randomhost/webcamoverlay` package, it does only support a small subset of the available image handling functions.

2. Usage
--------

[](#2-usage)

A basic approach at using this package could look like this:

```
