Download the PHP package sqrart/qart without Composer

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

sqrart/qart

Packagist

The open-source engine behind sqr.art. Every QR code sqr.art produces comes out of this engine — the code you are reading is the one running in production, verifiable end to end (every code is read back by a real decoder before it ships).

Source image Encoded QR (halftone)

The image on the right is a real, scannable QR code: the photo is encoded into the code's own data and error-correction bits, not pasted on top.

Want the finished product rather than the engine? sqr.art adds dynamic links you can edit after printing, scan statistics, WiFi and SEPA-transfer codes, print-ready posters, and an API.

Artistic QR codes: the image is encoded into the QR's data and Reed–Solomon bits (the QArt approach), rendered as a colour halftone. The decoded URL is a fixed prefix + a unique identifier (serial + solution) for a server-side lookup.

Multi-version: QR v1 to v40, ECC L/M/Q/H. The version sets the grid (17 + 4×v modules per side) and the capacity (v5: 106 characters, v10: 271, v40: 2953). The per-version tables (Reed–Solomon blocks, alignment) are derived from chillerlan — the same library used as the oracle.

Cost and memory grow quickly with the version: v5 < 1 s, v10 ~1 s (warm cache), v20 ~1.3 s warm (15 s cold, 450 MB), v30 ~3 s warm (~1 min cold, 800 MB), v40 ~5 s warm (~3 min cold, 1.2 GB). The native acceleration (see below) halves the warm time from v20 up — the sqr.art demo caps itself at v5/v10/v15.

Requirements

Usage

No invalid QR can ship: the generated PNG is decoded back (the ZXing port bundled in chillerlan) and the URL verified. On failure it regenerates with a different serial and a reduced error budget, then throws GenerationFailedException.

Short URL mode (padding bits)

By default the URL fills the QR's whole capacity (UrlMode::Full). In UrlMode::Short, only the short URL (prefix + 8-character serial) is encoded, with an early terminator, and the padding bytes carry the image — the approach of the original QArt and of fuqr:

Two wins: a readable decoded URL and better fidelity (8 degrees of freedom per padding byte versus 5 per URL character — 1972 vs 1235 variables at v10 with this prefix). Decoders ignore the padding content (verified by a real decode on every generation); as with everything else, validate on your target devices before a large print run.

Protected zones

Guarantee that a logo or a face stays faithful: modules in protected zones consume the degrees of freedom first (front of the pivot order), the mask choice minimises the error on the bits the solver cannot control, and the error budget corrects any stragglers in priority.

Coordinates are fractions (0..1) of the cropped square. Several zones are allowed (chained ->protect()). If a zone overlaps the structurally fixed region (header/prefix, bottom-right) beyond what the mask and budget can recover, the result says so honestly through protectedMismatches and a warning — nothing is hidden.

Non-square images (Fit)

Fit::Cover (default) crops to a square (a crop window, or centred). Fit::Contain keeps the whole image, centred on a white square that blends into the quiet zone — suited to wide or tall logos.

Painted importance map & cropping

The painted map (an image mask aligned to the cropped square, luminance on a black background = importance) weights module priority — a boost (×3 at most), not a guarantee:

paint() and protect() combine: a hard guarantee on the logo, a brush on the rest of the subject.

SVG output (print-ready)

Passing a 4th argument to generate() also produces a vector SVG — printable at any size without artefacts, from the same matrix as the PNG (which stays the decode-validated reference):

File size is kept in check by merging sub-pixels into horizontal runs (colours quantised to 32 levels per channel, imperceptible).

Dot and finder styles

The finder colour is constrained in luminance (<= 0.35): a colour too light would break detection and is rejected (QArtException). Styles apply to both outputs (PNG and SVG).

ECC levels (L/M/Q/H)

Raising the ECC level lowers the data capacity (v10: 271 characters in L, 119 in H) — hence the modules the solver can control — but raises the number of sacrificeable ECC codewords by as much: the errorBudgetPerBlock cap is ⌊ecc/block / 2⌋ - 2 (v10-L: 7, v10-H: 12). In practice L maximises halftone fidelity; H is relevant for high-contrast full-module renders or codes destined for damaged surfaces. The generator matrix is cached per (version, ECC) pair.

Full-module pixel art

In RenderMode::Module, each module is a solid square tinted by the image's average colour there: the whole QR is the image, dithered (Atkinson) to the module resolution. No texture, no dots — module luminance is constrained by lDotDark/lDotLight. This is where ECC-H shines: the lost capacity costs nothing (fewer modules to control) and every sacrificed codeword forces 8 more pixels toward the image. Dot shapes are ignored; rounded finders and the brand colour still apply. PNG and SVG outputs (one rect per run of modules).

Choice of dithering

Four algorithms, applied to the halftone texture as well as the pixel-art target: Atkinson (soft, the historical default), FloydSteinberg (full diffusion, more detail), Ordered (8×8 Bayer matrix, a regular retro screen), None (raw thresholding, posterised flats). In pixel art the choice changes the target the solver pursues; in halftone it only changes the texture (the target stays the thresholded 3×3 core).

PDF export (print-ready)

A vector PDF 1.4 assembled with no dependency (FlateDecode streams), sized in millimetres, quiet zone included (default 100 mm, ~40 mm minimum recommended in halftone). Same visual rules as the SVG — dot styles, rounded finders, full-module pixel art. Adjacent rectangles overlap by ~0.02 mm to neutralise the anti-aliasing seams of viewers. RGB colours (CMYK conversion is left to the printer).

Render profiles

Static payloads (WiFi, vCard, EPC…)

With serialLength: 0 (Short mode only), the encoded content is exactly the prefix you pass — no random serial is appended. Every byte is accepted (spaces, UTF-8, line breaks): ideal for standard payloads scanned offline.

The image lives in the padding bytes after the terminator. The probe matrix is shared across all payload lengths of a given (version, ECC) — the first generation of a version warms the cache for every payload.

Reproducible tests

The random generator is injectable: with SeededRandom, the output is byte-for-byte deterministic (golden tests).

Native acceleration (Rust, optional)

The GF(2) Gaussian elimination can be delegated to a Rust library through FFI. Detection is automatic ($QART_GF2_LIB, otherwise native/target/release/) and the pure-PHP fallback is transparent; the result is byte-for-byte identical (verified by the test suite). ffi.enable=1 is required in CLI/worker contexts (PHP's default is preload).

Measured figures (Apple Silicon, warm matrix cache): the elimination goes from 1.1 s to 0.07 s at v30 (~×16), a full v30 generation from 5.0 s to 2.8 s. Cold, the dominant cost stays the probing of the generator matrix (~1 min at v30, once per version/ECC pair thanks to the cache) — that is chillerlan, not accelerable by this library.

Structure

Tests

The suite covers: bit→module mapping against the real render (0 errors across the 8 masks), zigzag count (2768), interleaving bijection, affine alphabet (32 URL-safe values H-W/h-w), image edge cases, end-to-end generation validated by decoding, determinism and caching.

Known limitations

License

MIT © CAMINA. The hosted product lives at sqr.art.


All versions of qart with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-gd Version *
chillerlan/php-qrcode Version ^5.0
ext-zlib Version *
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 sqrart/qart contains the following files

Loading the files please wait ...