Download the PHP package bnussbau/trmnl-pipeline-php without Composer

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

ePaper Pipeline PHP

Latest Version on Packagist License Tests Total Downloads

ePaper Pipeline PHP provides a streamlined API, based on the pipeline pattern, for converting HTML content (or images) into optimized images for e-Paper devices. The image processing pipeline includes features like scaling, rotation, grayscale conversion, color quantization, and format-specific optimizations. This package is used in usetrmnl/larapaper. Devices model presets are provided by the TRMNL Models API.

Command line wrapper for this package: epaper-pipeline-cmd

browsershot_cham2v3cji4nbZ5JXN6_processed

Features

Requirements

Installation

You can install the package via composer:

Usage

With Model Configuration

Render HTML and convert to image compatible with the TRMNL OG model.

Generates PNG 800x480 8-bit Grayscale Gray 4c

Image Processing Only

Generates BMP3 800x480 1-bit sRGB 2c

Manual Configuration

Setting the Browser Timezone (optional)

You can control the timezone used by the headless browser when rendering your HTML by calling timezone() on BrowserStage with any valid PHP timezone identifier (e.g., UTC, America/New_York, Europe/Berlin).

Notes:

Example:

Browser Rendering on AWS Lambda

You can use different Browsershot implementations (like BrowsershotLambda) by passing an instance to the BrowserStage. See installation instructions and requirments for stefanzweifel/sidecar-browsershot.

This allows you to use BrowsershotLambda or any other Browsershot implementation that extends Spatie\Browsershot\Browsershot.

Testing with Fake Mode

You can use the fake() method to prevent actual Browsershot and Imagick operations:

API Reference

Pipeline

The main pipeline class that orchestrates the processing stages.

BrowserStage

Converts HTML or a URL to PNG images using Spatie Browsershot. You must provide content via either html() or url() (mutually exclusive).

Screenshot from URL with dithering (recommended for full-color or image-heavy pages):

ImageStage

Processes images for e-paper display compatibility.

Dithering

Recommended for photos but not for images containing mostly text, where it can make edges and letters appear rough or unclear. Dithering converts a grayscale photo into only black and white pixels by using patterns or noise to simulate intermediate shades, creating the illusion of continuous tones through spatial averaging.

Color Support

The pipeline supports color images via palettes defined in palettes.json. Models can specify one or more palette IDs, and the first palette with a colors array will be automatically applied. Color palettes use RGB colorspace for quantization and support dithering.

Example 1: Using Model Preset with Color Palette

Example 2: Defining Color Palette as Array

Model

Access device model configurations.

Development

Running Tests

Code Quality

License

MIT License. See LICENSE file for details.

Contributing

  1. Create an issue to discuss your idea
  2. Fork the repository
  3. Create a feature branch
  4. Make your changes
  5. Add tests to maintain coverage
  6. Run the test suite
  7. Submit a pull request

All versions of trmnl-pipeline-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-imagick Version *
spatie/browsershot Version ^5.0
league/pipeline Version ^1.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 bnussbau/trmnl-pipeline-php contains the following files

Loading the files please wait ...