Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why Your WebP Is Larger Than the Original PNG

Converting an image to WebP does not guarantee a smaller file. If your exported WebP outweighs the original PNG, check the image content and encoder settings before assuming the converter is broken. Here is a practical way to investigate. 1. Check whether the PNG uses very few colors Logos, icons, and simple interface graphics can compress efficiently as PNG. Converting these images to lossy WebP…

When you convert a PNG image to the WebP format, it does not always result in a smaller file size. If the exported WebP ends up being larger than the original PNG, there are a few factors to consider before concluding the converter is faulty. To troubleshoot, follow these steps:

1. Examine the image content. Images with a limited color palette, like logos and icons, often compress well as PNG. However, when converted to lossy WebP, the color representation changes. This alteration can introduce extra color variations that are more challenging to compress, leading to a bigger file size. For graphics with sharp edges or few colors, try converting them to lossless WebP initially.

2. Distinguish between quality and compression effort. In lossy mode, higher quality settings tend to increase file size. However, achieving a quality level of 100 does not enable lossless compression. Compression effort, on the other hand, is a separate setting. Allowing the encoder more processing time can yield better compression results without needing to lower the quality setting.

Using Google’s cwebp tool, you can generate two candidates: a lossy version with moderate quality and high compression effort, and a lossless version with high compression effort.

3. Compare the outputs. Maintain the same dimensions while comparing the compression. Resizing the images together can make it difficult to pinpoint why the file size changed. Check the following: the downloaded file size in bytes, small text and thin lines at 100% zoom, gradients to spot any banding, and transparent edges against both light and dark backgrounds.

For browser-based conversions, tools like PNG to WebP Converter can also be used. Apply the same checks to the output from these tools; keep in mind that the available controls may differ between tools.

Ultimately, the decision to use WebP should be based on whether the resulting file size is smaller and meets your visual requirements. If the PNG produces a better result, retain it. A successful conversion results in a valid file, and successful optimization should demonstrate a measurable improvement in file size.

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

Prototype hover, press and focus animation in SVG before you build the app

A mockup cannot tell you whether a button answers a press in 150 milliseconds or 600. You find out by using it. Building the real interaction means wiring state, routing and data first, so the cheap…

  • Prototype hover, press, and focus animations in SVG before full app development
  • Use SVG element with CSS styling for button creation and state transitions
  • Test prototype in headless Chrome, note potential browser and device differences

5 Places Custom React Hooks Make Your Code Better

You add a search box to a page. A timer delays the search until the user stops typing. Then another page needs the same behavior. You copy the timer, the effect, and the cleanup.

  • useDebouncedValue hook delays component updates until input settles
  • custom hook maintains latest input and debounced values in state
  • updates only occur after set delay, avoiding expensive work on each keystroke

Polymarket Trading Bots: How to Build the Decision Engine

Getting market data is easy. Deciding what to do with it is the difficult part. A Polymarket trading bot can connect to the API. It can stream market data. It can read an order book.

  • Polymarket trading bot uses API for market data
  • Decision engine normalizes market state for analysis
  • Engine compares model probability with market-implied probability

Modeling the Boundary Between Dispatch Data and QuickBooks Invoicing

At 3:30 p.m. on a Thursday, an invoice question can reveal a data ownership problem. QuickBooks may show the draft invoice, while the dispatch record contains the field reality: extra sourcing time, a…

  • Dispatch record contains definitive information like additional sourcing time and scope changes
  • QuickBooks governs accounts receivable, payroll rules, and invoice numbering
  • Structured Dispatch Reconciliation and sign-off process prevents data inconsistencies

More from Thursday 1 October →