Skip to content

Repository files navigation

TrueAlpha logo

TrueAlpha

Inspect whether PNG assets are truly transparent — locally in your browser.

Live Demo · 简体中文

CI GitHub Pages MIT License Release v0.1.0

TrueAlpha workflow demonstration

Why TrueAlpha

A PNG extension does not prove that an asset has usable transparency. Files can be fully opaque, carry an unused alpha channel, include a white or gray background, or contain a checkerboard baked into their pixels. TrueAlpha inspects both the PNG structure and decoded alpha pixels so asset problems are visible before they reach a game, build pipeline, or design handoff.

TrueAlpha runs entirely in the browser. Images are never uploaded, no account is required, and there is no remote analysis API.

Features

  • Batch import by picker or drag and drop, with duplicate, size, type, and batch-limit checks.
  • PNG signature, IHDR, bit-depth, color-type, alpha-channel, and tRNS inspection.
  • Exact transparent, semi-transparent, and opaque pixel statistics.
  • Content bounding box, transparent margins, edge occupancy, corner samples, and boundary color analysis.
  • Conservative suspected solid-background and baked-checkerboard heuristics with confidence and reasons.
  • White, black, gray, red, green, blue, and checkerboard previews.
  • Fit, native-size, zoom, content-box, and transparent-margin preview tools.
  • Search, filter, sort, reanalyze, delete, and clear batch controls.
  • JSON and CSV reports without embedded source-image data.
  • Non-destructive transparent-padding trim with 0, 2, 4, 8, or 16 px retained margin.
  • English and Simplified Chinese UI, system-aware dark mode, and manual theme controls.
  • Worker-based image analysis so large assets do not monopolize the main interface thread.

Live Demo

The repository includes a GitHub Pages workflow that deploys every push to main. Open the published app at kanadek.github.io/true-alpha.

For an offline-compatible local session:

npm install
npm run dev

Screenshots

Desktop workspace

TrueAlpha desktop interface

Batch inspection

TrueAlpha batch results

Detail preview

TrueAlpha detail preview on alternate backgrounds

How It Works

  1. TrueAlpha validates the PNG signature and reads IHDR and transparency-related chunks from the original ArrayBuffer.
  2. A browser worker decodes the image into RGBA pixels with createImageBitmap and OffscreenCanvas when supported.
  3. The analysis engine counts alpha values, finds non-transparent bounds, samples edges and corners, and runs conservative background heuristics.
  4. The UI presents independent labels instead of forcing every file into one oversimplified verdict.

The parser does not infer file structure from the extension or from Canvas output alone.

Detection Rules

Label Meaning
REAL_TRANSPARENCY At least one decoded pixel has alpha below 255.
FULL_TRANSPARENCY_PRESENT At least one decoded pixel has alpha 0.
ALPHA_CHANNEL_UNUSED The structure supports transparency, but all decoded pixels are opaque.
FULLY_OPAQUE No transparent or semi-transparent pixels were found.
SEMI_TRANSPARENT_PIXELS At least one pixel has alpha from 1 through 254.
EDGE_CONTENT Non-transparent content occupies a configured share of the outer edge.
TRANSPARENT_PADDING Meaningful transparent space exists outside the content bounds.
SUSPECTED_SOLID_BACKGROUND Opaque edge and corner samples are dominated by a low-variance color.
SUSPECTED_BAKED_CHECKERBOARD Two similar light or gray colors repeat with checker-like periodicity near the boundary.
CLEAN_ASSET Real transparency is present without a strong solid-background or checkerboard warning.

Solid-background and baked-checkerboard results are heuristic. They are always shown as Suspected, include a confidence score and reason, and can be false positives. Semi-transparent pixels are not automatically errors: antialiasing, soft edges, glow, and shadows often require them.

Privacy

  • Source files stay in browser memory.
  • Analysis is performed locally in your browser.
  • TrueAlpha has no server, database, account system, telemetry endpoint, or external image API.
  • Reports contain measurements and filenames, never the original image bytes or data URLs.
  • The production application makes no image-upload request.

Local Development

Requirements: Node.js 22 or newer and npm.

npm install
npm run dev
npm run lint
npm run typecheck
npm run test
npm run test:e2e

Synthetic test assets are generated in-repository and do not rely on third-party images:

npm run fixtures

Build

npm run build
npm run preview
npm run release:archive

The production output is written to dist/. The release command creates true-alpha-v0.1.0-static.zip with the static site and deployment instructions. GitHub Actions automatically uses the /true-alpha/ Vite base path for project Pages.

Roadmap

  • WebP and AVIF transparency inspection.
  • A CLI and reusable npm package.
  • Godot, Unity, and GitHub Action asset-acceptance integrations.

These are roadmap items only and are not included in v0.1.0.

Contributing

Issues and focused pull requests are welcome. Read CONTRIBUTING.md for setup, test, and heuristic-change expectations.

Known Limitations

  • Solid-background and checkerboard detection is heuristic and cannot guarantee a correct visual interpretation.
  • Ordinary pixel art, textile patterns, grids, and deliberately flat borders can resemble a baked checkerboard or solid background.
  • Imports are limited to 25 MB per PNG, 100 files per batch, and 32 million decoded pixels per image to bound browser memory use.
  • Very large images remain constrained by each browser's decode and canvas limits even though analysis work normally runs off the main thread.
  • Color-managed PNGs can be decoded differently across browsers.
  • TrueAlpha inspects and trims PNG files. It is not a background-removal or image-editing tool.
  • Animated PNG timing and frame-by-frame analysis are outside v0.1.0.

License

MIT © 2026 TrueAlpha contributors.

Releases

Packages

Contributors

Languages