PNG Aspect Ratio Changer

Uploads a PNG, decodes it onto an off-screen canvas, and stretches it non-uniformly to match a target width:height aspect ratio (for example 16:9 or 1:1), keeping the original width fixed and computing the new height from the ratio, then lets you download the reshaped image. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool restretches a PNG to a new aspect ratio, entirely in your browser, by scaling it non-uniformly to hit an exact target proportion.

It's useful when a specific width:height ratio matters more than preserving the original visual proportions exactly.

What Is PNG Aspect Ratio Changer?

A client-side aspect-ratio tool that reads an uploaded PNG's pixel data and computes a new height (keeping the original width) that satisfies a target ratio you specify, like 16:9 or 4:3.

It builds on the same shared nearest-neighbor resampling helper the resizer tool uses, just with the target dimensions derived from a ratio instead of entered directly.

How PNG Aspect Ratio Changer Works

The tool keeps the source image's width unchanged and computes a new height as width times (targetRatioHeight / targetRatioWidth), rounding to the nearest whole pixel.

It then resamples the image to those new dimensions using nearest-neighbor interpolation, which stretches or compresses the content vertically to fit.

When To Use PNG Aspect Ratio Changer

Use it when a platform or template requires a specific aspect ratio (like a 16:9 banner or a 1:1 square thumbnail) and stretching to fit is acceptable.

It's also useful for quickly previewing how an image would look distorted to a different ratio before deciding whether to crop or pad instead.

Features

Advantages

  • Runs entirely client-side; the uploaded image is never sent to a server.
  • Directly targets a specific ratio rather than requiring you to calculate exact pixel dimensions yourself.
  • Reuses the same tested resampling helper as the resizer tool.

Limitations

  • Always stretches rather than crops or pads, which can visibly distort the image if the target ratio differs significantly from the original.
  • Only adjusts height relative to a fixed width; it can't hold height fixed and adjust width instead.

Examples

Stretch a landscape photo to square

Input

A 1200x600 PNG (2:1), target ratio 1:1

Output

A 1200x1200 PNG with the original content stretched taller to fill the square

The width stays at 1200 and the height is recalculated to 1200 to satisfy the 1:1 target ratio, visibly stretching the content vertically.

Match a 16:9 banner requirement

Input

A 800x800 PNG (1:1), target ratio 16:9

Output

An 800x450 PNG with the original content compressed vertically

Since 800 * (9/16) = 450, the height shrinks to 450 to satisfy the 16:9 target ratio.

Best Practices & Notes

Best Practices

  • If distortion is unacceptable for your use case, use the cropper or canvas size changer instead to reach a target ratio without stretching.
  • Preview the result before downloading, since the visual distortion at extreme ratio changes can be significant.

Developer Notes

The lib function computes the new height from the target ratio and the source width, then delegates the actual resampling to the shared resizeNearest helper, the same one png-resizer.ts wraps, so both tools share identical resampling behavior with different dimension-calculation strategies.

PNG Aspect Ratio Changer Use Cases

  • Matching a platform's required banner or thumbnail aspect ratio
  • Previewing how an image would look distorted to a different proportion
  • Quickly converting a landscape image toward a square or portrait ratio

Common Mistakes

  • Expecting the image to be cropped rather than stretched to reach the new ratio.
  • Not accounting for how much visual distortion a large ratio change introduces before committing to the result.

Tips

  • For a ratio change without any stretching distortion, use the canvas size changer to pad instead, or the cropper to crop instead.
  • Try a target ratio close to the original first to judge how sensitive the image is to distortion before making a dramatic ratio change.

References

Frequently Asked Questions