Before you start

Sharp’s maintainers released v0.35.6 on November 28, 2026. This tutorial uses its documented resize and metadata APIs, not a generation model or a hosted design service.

What you’ll make
A reusable Node script, three WebP covers and a dimension report, without changing the source.
What you’ll need
Node.js 20.9+, npm, and a JPEG or PNG master that can safely be cropped. The sample targets need enough resolution for the intended framing; small inputs should not be enlarged without approval.

Step by step

  1. Check the project and source

    Use a new npm project and review Sharp’s platform installation instructions. Point the script at one approved local image. Read the source metadata and account for EXIF orientation before making asset variants. If no input is available, stop or create a clearly marked synthetic test image.

  2. Build an export profile

    Write make-covers.mjs, reading the source path and keeping outputs in a new covers folder. Rotate from EXIF with autoOrient() before resizing, use fit cover with a centered crop initially, and generate 1280 × 720, 1080 × 1080 and 1080 × 1920 WebP files. Preserve the original.

  3. Review and adjust each crop

    Open all three crops. A centered crop is only a starting point. If it cuts important elements, write down which output needs an explicit composition adjustment. Use an intentional focal crop or letterboxing when a tight portrait crop would remove the subject.

  4. Verify the files

    Read metadata from each output and require exact width, height and WebP format. Compare the source hash before and after, and generate report.json with dimensions, file sizes and whether each crop was visually inspected.

Commands

npm init -y
npm install --save-dev --save-exact --ignore-scripts sharp@0.35.6
node -e "console.log(require('sharp').versions.sharp)"
# Write make-covers.mjs, then pass a path to an owned JPEG or PNG:
node make-covers.mjs ./cover-master.jpg

Sign-in & permissions

No sign-in, API key, stock license purchase, external image transfer or upload. npm may fetch native Sharp binaries for the selected platform. Use original or authorized artwork only.

No agent skill or MCP service is required. Use the local Sharp package and a short, reviewable Node script.

Prompt for your agent

Use with: Codex, Claude Code, or another terminal-enabled agent with Node.js 20.9+.

Copy the whole prompt into a supported agent. After any manual step, tell the same agent to continue from that step.

Use a clean project folder for this workflow: Make a reusable thumbnail export kit with Sharp. Supported setup: Codex, Claude Code, or another terminal-enabled agent with Node.js 20.9+.. Start from the original documentation: https://sharp.pixelplumbing.com/install/.

1. SET UP
Check the version, inspect npm’s metadata and prefer the platform’s official prebuilt optional dependencies. If loading Sharp fails, report the actual platform error and relevant upstream guidance, not a silent privileged install. Keep the image local and never overwrite it.

Documented commands or code reference (respect the comments and replace placeholders before running individual commands):
npm init -y
npm install --save-dev --save-exact --ignore-scripts sharp@0.35.6
node -e "console.log(require('sharp').versions.sharp)"
# Write make-covers.mjs, then pass a path to an owned JPEG or PNG:
node make-covers.mjs ./cover-master.jpg

2. PAUSE FOR ME IF NEEDED
For a host install, sign-in, permission screen, or model download that needs my consent, stop and tell me the exact app, control and what will be authorized. Do not enter passwords, OTPs or secrets in chat. Resume after I confirm.

3. BUILD THE FIRST RESULT
Write make-covers.mjs to generate three WebP covers from my local master image: landscape 1280×720, square 1080×1080, portrait 1080×1920. Use sharp(input).autoOrient().resize({width,height,fit:'cover',position:'centre',withoutEnlargement:true}).webp({quality:86}) as the initial crop. If withoutEnlargement would make the export smaller than the target, stop rather than silently upscale. Preserve the input and write only to a new output folder. Open each crop to inspect the subject and any text, and use a deliberate new crop or margins for a bad framing choice. Measure output width, height and format and record SHA-256 of the original before and after in report.json. Mark visual review SKIPPED if you cannot view the images. Do not upload, publish or fetch images from outside.

4. CHECK THE RESULT
Programmatically validate width, height, format and readable nonempty outputs. Check the three crops visually and report what was cut or letterboxed. Verify the original SHA-256 did not change. Give me the actual file paths and anything that still needs a manual action. Do not publish or make a purchase.

Sources