Images on a page

A photograph compressed once and then compressed a second time by whatever put it into the document comes out soft, blotchy at the edges, and heavier than the original was. It is the commonest way a good picture is spoilt between the camera and the printer, and nothing in the finished file admits that it happened.

Here a photograph goes into the document exactly as it came out of the camera, without being squeezed a second time, and a picture with transparent parts keeps them transparent. Each one gets a page cut to its own size, so what comes out is what went in and anybody can check it by laying the two side by side — a last page then arranges both the way a real document would.

What this example shows

  • A photograph passed through untouched, never squeezed a second time.
  • A picture whose transparent parts are still transparent.
  • A page cut to the size of the picture, so nothing is scaled.

The source code, complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The document itself

Open the document

Images on a page, first page

This document weighs 9.3 kB

This document is pictures and nothing else: it carries no font, so it had nothing to lose and its weight is what its pictures weigh. See the size of every example document.

Examples near this one

A gallery of picture formats

The four picture formats read — JPEG, PNG, BMP and TIFF — shown across every picture shipped with the library, each captioned with what its own file declares.

A picture fitted into a rectangle

One picture fitted into a rectangle of one size eight ways: three ways of sizing it, the same one stood in the top left corner with a 12-point inset, a quarter turn left, a quarter turn right, a turn of 20 degrees, and a left-to-right mirror — every panel drawing the picture at the place and the size the library worked out.

A page and a stamp inside table cells

A checking page for a pack somebody else sent: every row shows one of its pages, taken whole out of the file it arrived in, beside a stamp drawn once and placed in every row that was given it. Both are fitted to the cell the table leaves them, claiming no width from their column and no height from their row.

Two orders, one frame, one bottom edge

An order of four lines and one of seven, in frames of the same height, both ending on the same bottom edge. Underneath, two notes of unequal length whose lines are moved apart until each reaches the foot of its frame.

Every example, by subject