SShortSingh.
Back to feed

Why JPEG Can't Store Transparency and How Background-Removal Tools Actually Work

0
·20 views

Background-removal tools rely on one of three algorithms: AI subject detection, flood-fill (connected area), and color-key removal, each suited to different image types. Transparency requires an alpha channel, which only formats like PNG and WebP support per pixel, while JPEG cannot store it at all by specification. When a transparent canvas is exported as JPEG — in browsers or via libraries — the transparent areas are silently filled with black rather than preserved. The color-key method is fast on flat backgrounds but will also erase matching colors found inside the subject itself, a common source of unintended holes. Tools like Windows 11 Paint, GIMP, macOS Preview, and PowerPoint each use different approaches, making format and method selection critical for clean results.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How to generate isometric and hexagon grid paper for print with accurate spacing

A developer explains how to produce isometric and hexagon graph paper for printing, working in PDF points where one inch equals 72 points. A common error is spacing isometric lines by the triangle side length rather than its height, which distorts the triangles. The fix is to anchor all three line families to a shared lattice point at the page centre and round coordinates to avoid duplicate edges. For hexagon grids, the article clarifies that a tabletop '1 inch' usually means the across-flats width, which implies a side length of about 0.577 inches. Finally, it recommends centring whole cells within the margins so the grid looks balanced.

0
ProgrammingDEV Community ·

osFoundry lets Codex CLI run as a worker on a user's Mac via ChatGPT login

A desktop agent in the osFoundry app can use Codex CLI as its model, launching codex exec on the user's Mac under their existing ChatGPT login. Work runs inside a folder the user has authorized, and Codex's reasoning, commands, and final message appear as lines in the osFoundry run. No OpenAI API key is involved, since the app strips API-key and base-URL variables from the child process so the run stays on the subscription, and cost is recorded as zero. Tools such as memory search are served through a loopback MCP bridge, and only when a git worktree isolates the run. Setup involves installing Codex CLI, logging in once, selecting the agent in the External AI settings, and choosing a folder for it to work in.

0
ProgrammingDEV Community ·

Free Servers Forget Everything: Five Myths About Ephemeral Deployments

Developers often assume free compute and model endpoints retain state, but such resources are typically shared and disposable. Apparent persistence may just reflect landing on the same machine during a lucky restart window. The article offers a stdlib-only Python probe that writes a small JSON state file and compares results across runs and restarts. Its results show that persistence can be confused with same-host luck, and that even surviving state needs write-then-read verification. It also argues that job state such as counters, cursors, and sent markers belongs in an external store rather than in process memory, and that chat endpoints are request-scoped, so context must be resent by the client.

0
ProgrammingDEV Community ·

From Cricket Bans to Binding Pockets: Building Mental Models for Viral Glycoproteins in VR

From Cricket Bans to Binding Pockets: Building Mental Models for Viral Glycoproteins in VR The notification hit my phone at 11:47 PM on a Tuesday. EU bans house cricket protein in food products — EFSA cites insufficient safety data on allergen cross-reactivity. I stared at the screen, thumb hovering. Three years of grant proposals, late-night sequencing runs, and that one spectacular failure with the cryo-EM grid — all circling back to a regulatory footnote about insects I'd never even held. My lab works on viral glycoproteins.