Download the PHP package marekskopal/lithophane without Composer

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

Lithophane

Turn a photo into a printable flat lithophane STL — as a PHP library and a command line tool.

Dark pixels become thick, light pixels thin; held against light, the print shows the photo.

Features

Requirements

Installation

Command line

Option Default Meaning
-o, --output image name with .stl Output STL path
-p, --preview – Also write a PNG preview of the backlit result
-f, --frame frame Frame option, see below
--width, --height 100, 100 Outer size including the frame (mm); the hook tab is added on top
--resolution 0.2 Distance between relief points (mm/pixel)
--min-thickness, --max-thickness 0.6, 3.0 Thickness of white / black areas (mm)
--frame-width 7.5 Border size, "Base Height" on lithophanemaker.com (mm)
--frame-depth 7.5 Frame thickness, "Depth" on lithophanemaker.com (mm); the plate is centred in it
--overhang-angle 60 Slope of the ledges between frame and plate, from vertical
--tab-width, --tab-height 20, 15 Hook tab size (mm)
--hole-diameter 5 Hook tab or keychain hole diameter (mm)
--tunnel-diameter 2 Twine tunnel size (mm)
--stand-thickness, --stand-angle 2, 75 Printing stand thickness along the width (mm) and leg angle from horizontal
--x-shift, --y-shift 0.5 Crop position (0 = left/top, 1 = right/bottom)
--crop-scale 1.0 Fraction of the largest crop rectangle with the picture's aspect ratio
--invert off Negative lithophane
--orientation upright upright (X = thickness, Y = width, Z = height) or flat (lying on its back, relief up)
-c, --config – JSON preset with any of the options above (kebab-case or camelCase keys)
-s, --settings – lithophanemaker.com settings-*.txt (all frame options)
--dry-run off Print dimensions, triangle count and file size estimate without writing the STL

Settings are applied in this order, later ones winning: defaults, --settings, --config, other options.

Frame options

--frame lithophanemaker.com Shape
frame Frame Only Border around the plate, ledges sloped by the overhang angle on all four sides
twine-tunnels Twine Tunnels Frame with square tunnels running diagonally through both top corners, for hanging on twine
hook-tab Hook Tab Frame with a rounded tab and hole above the top centre
keychain-hole Framed Keychain Hole Top Left Frame with a hole through the top left corner
none No Border The bare plate
stand No Border and Printing Stand Bare plate with an A-frame stand at both sides: legs at the stand angle, a base bar and braces

The stand is written as separate closed solids overlapping the plate; slicers merge them into one object. An example preset is in examples/hook-tab.json.

Library usage

LithophaneConfig::fromArray() builds a config from loose values (for example a decoded JSON preset), and LithophaneMakerSettings::fromFile() imports a lithophanemaker.com settings file:

To stream triangles somewhere other than an STL file, implement MarekSkopal\Lithophane\Geometry\TriangleSink and pass it to $generator->mesh($field, $sink, $config->orientation).

How it works

  1. Crop the image to the picture's aspect ratio and resample it to one sample per grid point.
  2. Brightness → thickness: t = max − L · (max − min), with L the Rec. 601 luma (0 = black, 1 = white).
  3. Height field: picture, frame and hook tab live in one grid with a front and back surface per point; holes and outlines are cells marked empty, twine tunnels are cells hollowed out between two heights. The plate is centred in the frame, ledges slope by the overhang angle, and under the top bar the slope continues down to the relief.
  4. Mesher: emits a closed, manifold solid — relief, back, tunnels and walls on every boundary.
  5. Binary STL is streamed to disk in the requested orientation.

A 90 × 90 mm lithophane at 0.2 mm/pixel with a frame as thick as the plate is about 410 k triangles / 20 MB and takes about 2 s; with a thicker frame (the default) the back is no longer flat and the file roughly doubles.

Running tests

CI requires at least 98 % line coverage.

License

MIT, see LICENSE.


All versions of lithophane with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-gd Version *
symfony/console Version ^8.1
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 marekskopal/lithophane contains the following files

Loading the files please wait ...