Download the PHP package zielu92/filament-image-labeler without Composer

On this page you can find all versions of the php package zielu92/filament-image-labeler. 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 filament-image-labeler

Filament Image Labeler

A Filament plugin for annotating images with rectangles and polygons. Built on Annotorious, it provides a canvas-based drawing tool as a Filament form field, plus a polymorphic persistence layer so any Eloquent model can have annotations.

Features

Installation

Run the migration (auto-loaded from the package, no publishing needed):

How It Works

The package has two parts:

  1. ImageLabel form field — Renders an image with an Annotorious overlay. Users draw shapes on the image. The component emits its state as a JSON array of [{id, target}] objects where id is a unique annotation identifier and target contains the W3C Web Annotation geometry data.

  2. Persistence layer — An Annotation Eloquent model and HasAnnotations trait that store annotations in a polymorphic annotations table. Each annotation has an annotation_id (the Annotorious UUID), geometry (JSON), and an optional metadata (JSON) column for any app-specific data.

Database Schema

Usage

1. Add the trait to your model

This gives your model:

2. Add the ImageLabel field to your Filament form

3. Sync annotations on save

The ImageLabel component emits raw geometry data. Your app decides what metadata to attach. Use Filament's page lifecycle hooks to persist:

4. Hydrate annotations on edit

Full Example: Repeater with color swatch

A common pattern is to pair the ImageLabel with a Filament Repeater that shows editable metadata for each annotation. When ->coloredAnnotations() is enabled, you can display a matching color swatch in the repeater:

The hashColor helper (same djb2 algorithm used internally by the package) is available as AnnotationColor::forId($id, $palette).

Each repeater row displays a colored square that matches the annotation's color on the canvas. The color is deterministic — same annotation ID always produces the same color, regardless of order.

When a user deletes a repeater item, the afterStateUpdated callback rebuilds the canvas state from the remaining items, effectively removing the annotation from the image as well.

Tip: If you want annotations to only be removable from the canvas (not the repeater), set ->deletable(false) and rely solely on the "Clear All" button or Annotorious's built-in delete (select + backspace).

The syncAnnotations Method

Behavior:

The geometry field accepts either an array or a JSON string (auto-decoded). The metadata field is nullable — pass null or omit it if you don't need custom data.

ImageLabel Configuration

Method Description Default
->image(string\|Closure $url) Image URL to annotate required
->enableSquare(bool $condition) Enable rectangle drawing tool true
->enablePolygon(bool $condition) Enable polygon drawing tool true
->enableClear(bool $condition) Show "Clear All" button true
->multiple(bool $condition) Allow multiple annotations true
->coloredAnnotations(array\|null $palette) Enable colored annotations with custom palette null (disabled)

Colored Annotations

By default, annotations use Annotorious's default styling (white/light blue outlines). To enable distinct colors per annotation, pass a color palette:

Each annotation gets a deterministic color based on a hash of its ID. The same annotation always gets the same color regardless of order. Colors cycle through the palette when there are more annotations than colors.

To use the color in your repeater (matching the canvas), use the package's AnnotationColor helper:

Working with Private Files

If your images are stored on a private disk, use temporary signed URLs:

Testing

The package provides the HasAnnotations trait which is easily testable:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

This package uses Annotorious for the image annotation canvas, licensed under the BSD 3-Clause License.

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-image-labeler with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/forms Version ^5.0
spatie/laravel-package-tools Version ^1.15.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 zielu92/filament-image-labeler contains the following files

Loading the files please wait ...