Urgent.News

What's breaking now, across thousands of outlets.

Tech

Transparent PNGs: the 3 background-removal algorithms, why JPG can't do it, and the color-key gotcha

Every "make this background transparent" tool is doing one of three things under the hood, and picking the wrong one for your picture is why a logo comes back with a hole in it, or the background is only half gone. Transparency lives in the alpha channel A pixel needs a fourth value beyond R, G, B: alpha, how see-through it is. Only formats that define an alpha channel can store it - PNG and WebP…

Transparency in digital images is defined by an alpha channel, which specifies how see-through a pixel is. Transparent PNG, WebP, and GIF formats can store this alpha channel, whereas JPEG does not support transparency. If you try to save a picture with transparency as JPEG, the result will be a black background behind everything.

There are three main algorithms for removing backgrounds from images: AI subject detection, connected area (flood fill/magic wand), and color key. AI subject detection segments the main subject from the background and handles complex backgrounds well. Connected area flood fill works by starting at a point you click and growing outward through similar colors.

Color key removes pixels close to a chosen color, but can cause issues if that color appears within the subject. Online removal tools use AI, but they upload images to their servers, which may not be suitable for sensitive documents. A local solution, such as Pillow, can be used for batch processing without uploading images. However, color key can cause problems if the background color appears within the subject.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Beyond Localhost MCP

MCP Is Easy Until You Take It to Enterprise Scale Why local MCP workflows eventually need a gateway, governance, identity, and observability layer Every major architectural shift begins with an…

  • Enterprise MCP Wall emerges as scaling challenges arise
  • Security gaps, server sprawl, visibility blind spots, governance hell surface
  • Enterprise MCP Gateway proposed as centralized control plane

Zero-Code OpenTelemetry Tracing for Dagster

If you run Dagster pipelines in production, you've probably wanted distributed tracing at some point — seeing exactly how long each op/asset took, how steps nest across a run, and how a run connects…

More from Tuesday 22 September →