NeoQuarZ:~Archetype
EN ⇄ ES
← Back to projects

Image preparation

Resize and adjust an image in the browser.

CanvasJavaScriptPNG
WEB PROTOTYPE

Use the sample image or open your own. Processing happens locally and exports PNG. This demo does not apply AI upscaling.

image.prepareLOCAL / PNG

View concept code
export function outputSize(w, h, width) {
  if (![w, h, width].every((n) => Number.isFinite(n) && n > 0)) throw Error('Invalid image size');
  const ratio = Math.min(width / w, 1600 / w, 1600 / h);
  return { width: Math.max(1, Math.round(w * ratio)), height: Math.max(1, Math.round(h * ratio)) };
}

To turn this into a production application

Add batch processing and evaluate a restoration or upscaling model as a separate module.

Talk about this project ↗
NEOQUARZ / ARCHETYPE~/projects/image-pipeline0%