Lab · A composite-rebar manufacturer

A prepress pipeline: raster layouts into print-ready vector with typography reset

A low-resolution raster layout becomes a print-ready vector PDF: the graphics go through AI upscaling, the typography is reset with a real font on top — text on a 1.5-meter banner stays sharp.

Client
A composite-rebar manufacturer
Timeline
2026
Role
Prepress-pipeline engineering
Status
The pipeline is proven on a real layout for a composite-rebar manufacturer and fixed as a repeatable studio production process.
1,500×1,000 mm
Print format from a 1,280×853 raster
the source is raster infographics with no layers, fonts, or vector data
150 dpi
Target print density
calculated for the banner's 1.5 m viewing distance; 600 dpi out of a 1,280 px raster is a myth
×16
Intermediate upscale factor
two Real-ESRGAN ×4 passes, then a Lanczos downscale to the target DPI
5
Deterministic pipeline stages
upscale, grid mapping, cleanup and typography reset, PDF assembly, outline finalization — each verified independently

Context

An industrial client's print material is increasingly assembled from raster sources: infographics prepared by generative tools, exports from presentations, layouts forwarded via messengers with no source files. This case arose the same way: a composite-rebar manufacturer needed to print a 1,500×1,000 mm banner, and the only available source was raster infographics at 1,280×853 pixels — no layers, no fonts, no vector data.

Stretching such a source straight to the print format gives obvious defects: blurred edges, staircase artifacts on lines, illegible text. AI upscaling solves half the problem — modern super-resolution models make flat graphics genuinely sharp. But the approach has a systemic flaw that shows up precisely on typography: small text acquires characteristic wavy, "generated" edges after neural enlargement. On screen it's barely noticeable; on a print canvas a meter and a half wide it reads as a defect from any close distance.

The second common trap is the cult of resolution. A "600 dpi for print" requirement out of a 1,280-pixel source is physically unachievable: no upscaling adds information that isn't in the source. The engineering answer is different: for a meter-and-a-half banner with a real viewing distance, 150 dpi is enough, and it was this density that was adopted as the target — with an honest understanding of where each pixel of the result comes from.

The task

The task had to be framed more broadly than "enlarge the picture": build a reproducible prepress pipeline that takes a low-resolution raster layout and outputs a print-ready PDF suitable for handoff to a print shop with no manual touch-up. Requirements for the result: sharp graphics at the target print density, typography indistinguishable from set-from-scratch, a background with no quality loss on the final export, fonts converted to outlines so the file opens in any prepress software without substitutions.

A separate requirement is repeatability. One-off manual retouching in a graphics editor doesn't scale and isn't documented. The pipeline must be assembled from standard open-source tools installed via brew and pip and run through a fixed sequence of steps — so the next layout goes the same path without reinventing the process and without depending on a specific operator.

The alternative of fully redrawing the layout from scratch was considered and rejected as economically disproportionate: the design is already approved by the client, the source's composition and color system are correct, only the medium — the resolution — is defective. The pipeline's job is to preserve the approved layout and raise it to print quality, not to create a new one.

Approach

The pipeline's key engineering decision is to separate the fates of graphics and text. They degrade differently on enlargement and require different recovery strategies: graphics can and should be pulled up with neural super-resolution, while small text can't be recovered — it has to be reset from scratch with a real vector font on top of the upscaled underlay. This principle is what distinguishes a prepress pipeline from "run it through an upscaler": the result contains not an imitation of letters but real typography with real outlines.

For super-resolution we chose the realesrgan-x4plus-anime model in the Real-ESRGAN ncnn-vulkan implementation: on flat art with spot colors and outline graphics — the typical visual language of infographics — it works noticeably cleaner than photographic models. Enlargement is done in two ×4 passes followed by a Lanczos downscale to the target density: the excess intermediate resolution lets the downscale trim the neural artifacts and yield a consistently clean underlay.

Typography reconstruction begins not with typesetting but with measurement. The source layout's grid — heading positions, body-text lines, column boundaries — is measured programmatically, with a dark-pixel detector on numpy projections rather than by eye: at a print format of a meter and a half, a placement error of a few source pixels turns into centimeters on the canvas. Then the font is matched. In this layout the typeface matched Roboto, and the narrow bold heading style matched Roboto Condensed Bold, which doesn't exist as a separate file but is instanced natively from variable Roboto with fontTools.

The final medium was deliberately chosen hybrid: not a high-resolution raster file but a PDF where a raster underlay and vector text coexist in one document of physical print size. This format solves both the quality problem — text stays vector at any scale — and the compatibility problem: the print shop gets a file with fonts converted to outlines that opens in any prepress software without substitutions and without requests for missing typefaces.

Architecture

The pipeline is assembled as a sequence of five deterministic stages. The first is upscaling: realesrgan-ncnn-vulkan with the realesrgan-x4plus-anime model and a ×4 factor is applied twice, after which the result is brought by a Lanczos filter to 150 dpi of the print format. The second is layout mapping: a numpy dark-pixel detector builds projections of the layout and fixes the coordinates of all text blocks and columns.

The third stage is cleanup and reset. Areas of the old raster text are covered with the flat background color using PIL, and a vector typesetting is prepared on top. The Roboto Condensed Bold style is instanced from the variable font with a fontTools instantiateVariableFont call on the wght 700 and wdth 75 axes — the output is a full static font suitable for embedding in a PDF.

The fourth stage is print-PDF assembly: reportlab creates a page of physical size 1,500×1,000 mm, places the upscaled underlay, and draws the text with vector drawString calls. Vertical positioning is done by calibrated baseline formulas: for headings the baseline sits at 0.711 of the cap height below the top of the block, for body text at 0.76 of the ascent height. These coefficients make the reset match the original grid with no manual tweaking.

The fifth stage is finalization for the print shop: ghostscript with the -dNoOutputFonts flag converts all fonts to outlines, while the -dColorImageFilter=/FlateEncode and -dDownsampleColorImages=false flags guarantee the background underlay passes the stage with no lossy re-encoding and no downsampling. Control at each step is done with poppler tools: pdfinfo checks the page geometry, pdffonts confirms the absence of embedded fonts after the outline conversion, pdfimages and pdftoppm allow inspecting the raster layers and the final render.

Engineering discipline

The whole pipeline toolkit is open-source and installed with standard package managers: poppler and ghostscript via brew; PIL, numpy, reportlab, and fontTools via pip; Real-ESRGAN ncnn-vulkan is a self-contained binary with models. The pipeline has not a single proprietary editor and not a single "open in a graphics editor and fix by hand" step — the process reproduces on any studio machine and survives a change of operator.

Every numeric decision in the pipeline is justified rather than inherited: 150 dpi is a calculation for the viewing distance of a meter-and-a-half banner, not a habit; the double ×4 pass with a subsequent downscale is a deliberate way to trim super-resolution artifacts; the baseline coefficients 0.711 and 0.76 are metrics of the specific styles, not eyeballed. This discipline turns a one-off order into a production asset: the next raster layout of any format goes through the same pipeline with different input parameters.

The separation of stages also gives an operational advantage: each of them is verified independently. The upscaled underlay can be assessed before the reset, the grid mapping checked against the source before cleanup, and the final PDF run through pdffonts and pdftoppm before shipping to the print shop. An error is localized at its stage rather than surfacing on the finished run, where the cost of a defect is the price of reprinting a meter-and-a-half canvas.

Result

The client got a print-ready vector PDF at 1,500×1,000 mm: sharp graphics at 150 dpi, typography set with a real font and converted to outlines, a background with no loss. The file goes to the print shop as is — with no "send us the source files" requests, which don't exist, and no manual touch-up on the printer's side.

For the studio the result is broader than one print run: the prepress pipeline is fixed as a repeatable process and has entered the production toolkit. The class of tasks "there's only a small raster — a large print is needed" is closed systematically: from generative infographics to legacy layouts whose sources are lost.

The business effect follows from the pipeline's structure rather than from a designer's hours: there is not a single manual-retouching step in the process, the entire toolchain is open-source and installed via brew and pip, and the deliverable is verified before handoff — pdfinfo for page geometry, pdffonts for the outline conversion, pdftoppm for the final render — so the file goes to the print shop already checked against the errors that usually trigger approval iterations.

What we built

  • Graphics upscaling

    Real-ESRGAN ncnn-vulkan, the realesrgan-x4plus-anime model, two ×4 passes; then a Lanczos downscale to 150 dpi of the print format — the excess intermediate resolution trims neural artifacts.

  • Layout-grid detector

    numpy dark-pixel projections measure the positions of headings, body-text lines, and column boundaries programmatically — no eyeballed mapping, which on a meter-and-a-half canvas turns into centimeter errors.

  • Raster-text cleanup

    Areas of the old text are covered with the flat background color using PIL — the underlay is prepared for the vector reset with no trace of the original letters.

  • Font instancing

    Roboto Condensed Bold doesn't exist as a separate file — the style is instanced from variable Roboto via fontTools instantiateVariableFont on the wght 700 and wdth 75 axes.

  • Vector-PDF assembly

    reportlab draws a page of physical size 1,500×1,000 mm: the upscaled underlay plus vector drawString text; baseline formulas (cap×0.711 for headings, asc×0.76 for body) seat the reset precisely on the original grid.

  • Outline conversion

    ghostscript -dNoOutputFonts -sDEVICE=pdfwrite converts fonts to outlines; -dColorImageFilter=/FlateEncode and -dDownsampleColorImages=false preserve the background with no loss and no downsampling.

  • PDF quality control

    poppler tooling at every step: pdfinfo — page geometry, pdffonts — confirmation of no fonts after the outline conversion, pdfimages and pdftoppm — inspection of raster layers and the final render.

Engineering challenges

"Generated" text after upscaling

Neural super-resolution makes graphics sharp, but small text gets wavy edges that read as a defect in print. The solution is architectural: text is not recovered but reset with a real vector font on top of the upscaled underlay.

Matching the reset to the original grid

The vector text has to land exactly on the raster's positions. The grid is measured with a numpy dark-pixel detector, and vertical seating is set by baseline formulas: 0.711 of the cap height for headings, 0.76 of the ascent height for body text.

A missing font style

The layout's typeface matched Roboto, but the narrow bold heading variant — Roboto Condensed Bold — doesn't ship as a separate file. The style is instanced from variable Roboto with fontTools (wght 700, wdth 75).

A lossless background at finalization

A standard PDF pass through ghostscript recompresses and downsamples raster layers. The -dColorImageFilter=/FlateEncode and -dDownsampleColorImages=false flags fix the background underlay losslessly while converting fonts to outlines.