Download the PHP package sportsgearswag/artwork-vectorizer without Composer

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

Artwork Vectorizer

Turns raster artwork into a colour-separated, print-ready SVG: one editable <g> per ink, plain hex fills, every colour snapped to its nearest Pantone Coated match. Built for screen printing, where the number of separations is the thing that costs money.

Quick start

Two commands and one line, in any Symfony project:

Then inject it and go — no service wiring, no parameters, no configuration:

Requirements

All three are required for production. The package technically runs on ImageMagick alone, but only by falling back to a pure-PHP tracer that emits straight segments with no curve fitting — correct, and wrong for a logo.

PHP 8.2+
Symfony 6.4, 7.x or 8.x (any, or none — the library works standalone)
ImageMagick colour separation. 7 (magick) or 6.x (convert), both supported
potrace highest edge accuracy — logos, text, hard edges
VTracer fewer path segments, faster — busy and shaded artwork

Install both tracers, not one. They are not interchangeable, and the auto preset picks between them per artwork; with only one installed every job goes through it whether it suits or not. On the same flat four-ink logo:

engine subpaths size time difference from original
potrace 15 3.8 KB 0.75s 1.61%
VTracer 14 2.6 KB 0.65s 2.69%

potrace wins on fidelity, VTracer on file size and speed — and the gap widens the other way on busy artwork, where potrace emits far more segments.

ImageMagick and potrace

VTracer

VTracer is a Rust binary and is not in apt, apk or brew — install the static release binary and put it on PATH:

The musl builds are static, so they need no runtime libraries and work on Alpine as well as glibc distros. cargo install vtracer also works if Rust is already available.

Both binaries must be on PATH on every machine that runs a conversion — each developer's machine, CI, and every deployed image. This is the step teams miss: it works locally and returns No tracing engine is installed on this server in production.

Check what a given server actually has:

Install

Published on Packagist, so there is no repositories block and no token to configure:

Use ^1.1 or newer if you pin a constraint. The bundle does not exist in 1.0, so a fresh install of 1.0.0 fails at container compile with no obvious cause. Symfony 8 needs ^1.1.1; earlier versions cap Symfony at 7.

Symfony

Register the bundle (Flex does this for you):

That is the whole integration — every service is wired for you. Inject VectorizerService anywhere:

Configuration is optional — these are the defaults:

To feed inks from your own source — a database table, an API — implement PaletteProviderInterface and name your service:

Without Symfony

Construct it by hand; see examples/convert.php.

Handing this to another team

It is on Packagist and the repository is public, so there is nothing to grant and nothing to configure. Send them these three steps.

1. Require it:

2. Register the bundle — one line, and then every service is wired:

3. Install the binaries on every machine that runs it — their local machines, CI, and each deployed image. This is the step teams forget, and the failure mode is a conversion that "works locally" and returns No tracing engine is installed on this server in production. See Requirements; the short version is ImageMagick is mandatory and both tracers are required — note VTracer is not in apt/apk/brew and needs its release binary.

4. Confirm the licence with the copyright holder. This package is proprietary (see LICENSE) — being able to clone a public repository is not the same as being licensed to use it. The owner saying yes is all that is needed, but get it in writing.

What they do not need

Worked example

sgs-designer is the reference integration. In full it is:

File Change
composer.json one require line
config/bundles.php one line
src/Controller/.../ArtworkVectorizerController.php inject VectorizerService, one upload route, one convert route returning JSON
templates/.../index.html.twig the upload form and the result view

No service wiring, no parameters, no compiler passes.

What convert() returns

The whole contract for building a UI on top of it:

Two of those are easy to miss and worth surfacing in any UI. engine is what actually ran — ask for vtracer on a server without it and this comes back potrace, silently. And paletteTruncated tells you the artwork had more inks than the preset allowed, which is the honest reason a result looks flat.

Presets

Pick by artwork type. inspect() will choose for you.

Preset Max inks For
logo 6 Spot-colour logos. Fewest layers, exact brand colours.
detailed 10 Keeps small accents and thin outlines.
illustration 24 Mascots, sticker and tee art.
photo 24 Posterised likeness. Not print-ready.
max_detail 48 Complex artwork. Slow, and the SVG gets large.

Output

Paths with plain hex fills only — no gradients, filters, clip paths or embedded raster — so it loads into any design editor. SvgAssembler::complianceIssues() asserts that.

Measuring quality

convert() is cheap. The two checks below re-render the SVG and compare it to the source, which costs 20-30 seconds, so call them only when you want the number:

A flat logo should land under ~3%. Gradients and photographs will not: they have no exact answer in flat inks, and assess() returns escalate rather than pretending otherwise.

Tests

The suite converts a real four-ink fixture and asserts the ink count, the Pantone matches, SVG compliance and a deviation ceiling. It skips if ImageMagick is missing, so CI runs --fail-on-skipped.

Licence

Proprietary — see LICENSE, which also carries the Pantone trademark notice and the licences of the external tools this package invokes.


All versions of artwork-vectorizer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-json Version *
symfony/filesystem Version ^6.4 || ^7.0 || ^8.0
symfony/process Version ^6.4 || ^7.0 || ^8.0
symfony/config Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.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 sportsgearswag/artwork-vectorizer contains the following files

Loading the files please wait ...