PNG Edges Hardener

Uploads a PNG and binarizes its alpha channel: every pixel at or above a chosen threshold becomes fully opaque and everything below becomes fully transparent, eliminating antialiased fringing entirely for a crisp, hard-cut edge, then lets you download the result. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool hardens a PNG's edges by binarizing its alpha channel, entirely client-side, converting every pixel to either fully opaque or fully transparent.

It's the direct opposite of the edge softener tool, and a more aggressive step than the edge refiner tool.

What Is PNG Edges Hardener?

A client-side PNG alpha-channel binarizer that applies a single threshold across every pixel: at or above the threshold becomes fully opaque, below becomes fully transparent.

The result has no partial transparency anywhere, producing crisp, hard-cut edges instead of smooth antialiased ones.

How PNG Edges Hardener Works

The tool reads each pixel's alpha byte and compares it directly against the chosen threshold value, writing either 255 or 0 back depending on the comparison.

RGB color values are never modified; only the alpha channel changes.

When To Use PNG Edges Hardener

Use it when you need pixel-art-style crisp edges, are preparing a sprite sheet that shouldn't have partial-transparency blending artifacts, or want to guarantee an image has no semi-transparent pixels at all before further processing.

It's also a quick fix for a cutout with messy, inconsistent antialiasing that you'd rather make uniform.

Often used alongside PNG Edges Refiner and PNG Edges Softener.

Features

Advantages

  • Runs entirely client-side; the uploaded image is never sent to a server.
  • Guarantees a fully binary alpha channel — useful for downstream tools/formats that don't handle partial transparency well.
  • Simple, predictable single-threshold behavior.

Limitations

  • It completely removes antialiasing, which can make curved or diagonal edges look noticeably more jagged.
  • A poorly chosen threshold can eat into a subject's edge or leave background remnants, depending on how the original alpha gradient was distributed.

Examples

Harden a soft cutout edge for pixel art

Input

A cutout PNG with antialiased edges, threshold 128

Output

The same PNG with every pixel now either fully opaque or fully transparent

The default mid-range threshold works well for typical antialiased edges.

Bias toward keeping more of the subject

Input

A cutout with a wide semi-transparent fringe, threshold 64

Output

More of the fringe pixels become opaque than with a higher threshold

A lower threshold is more permissive about what counts as 'opaque enough'.

Best Practices & Notes

Best Practices

  • Try a few different threshold values (e.g. 64, 128, 192) and compare results, since the ideal cutoff depends on your specific image's alpha distribution.
  • Use this as a final step after other edge cleanup, since it's a one-way, destructive operation on the antialiasing.

Developer Notes

hardenPngEdges is a pure lib function operating on a plain Uint8ClampedArray PixelBuffer: it iterates only the alpha byte of each RGBA quad and applies a single-threshold binarization, leaving color channels untouched — no DOM access until the component paints the result for preview/download.

PNG Edges Hardener Use Cases

  • Preparing pixel-art-style sprite sheets with no partial transparency
  • Guaranteeing a binary alpha channel before exporting to a stricter format
  • Standardizing inconsistent antialiasing across a batch of cutout images

Common Mistakes

  • Applying this to a naturally soft-edged subject (like hair or fur) and losing the fine detail that made the softness look natural.
  • Picking a threshold without previewing the result — the right cutoff varies a lot between images.

Tips

  • If hardening looks too harsh, try the gentler edge refiner tool instead, which only cleans up the extremes.
  • Combine with the edge cleaner tool afterward to also remove any isolated single-pixel specks left behind.

References

Frequently Asked Questions