frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Using edge detection to preserve significant features while downsampling

http://yogthos.net/pixel-mosaic.html
2•yogthos•1h ago

Comments

yogthos•1h ago
Most pixelation libraries take the lazy route where they just downscale the image and then upscale it back with nearest neighbor interpolation. It's fast but the results are usually pretty messy because the grid just cuts right through important features like faces or distinct edges. You lose a lot of the actual character of the image that way.

I tried something different where I treat pixelation as an optimization problem rather than a simple scaling operation. Instead of forcing a rigid grid onto the image it adapts the grid to match the underlying structure of the picture. The end result is pixel art that actually preserves the semantic details of the original image while still nailing that low-res aesthetic.

The secret sauce here is an edge-aware algorithm. It starts by running Sobel operators to detect edges and gradient magnitude. Once it has that data it initializes a standard grid but then iteratively moves the grid corners around to snap them to those detected edges. It uses a search-based optimization to test local positions for each corner and finds the spot that aligns best with the image boundaries.

It’s definitely heavier than the naive approach but optimizations to keep it usable. The edge detection runs on WebGL so you get a massive speedup there and it uses spatial hashing for O(1) lookups during the rendering phase. On modern hardware you are looking at maybe 100 to 500ms per image which is fast enough for most purposes. It’s pretty cool seeing the grid warp to fit the content rather than just chopping it up blindly.

https://github.com/yogthos/pixel-mosaic

Is your website Archive Ready?

https://archiveready.com/
1•pabs3•1m ago•0 comments

Gogs 0-Day Exploited in the Wild

https://www.wiz.io/blog/wiz-research-gogs-cve-2025-8110-rce-exploit
1•rkta•1m ago•0 comments

Show HN: Testify to your NIST CSF maturity with evidence to prove it

https://github.com/clay-good/nisify
1•hireclay•2m ago•0 comments

U.S. Seizes Oil Tanker Off Venezuelan Coast, Escalating Pressure on Maduro

https://www.nytimes.com/2025/12/10/us/politics/oil-tanker-seized-us-venezuela-trump.html
1•zzzeek•5m ago•0 comments

Claude Code Space Invaders Game

https://space-invaders.centminmod.com/
2•vbtechguy•5m ago•1 comments

Returning Astronauts forget gravity exists for a while [video]

https://www.youtube.com/shorts/cQ3Msm659Fw
1•lifeisstillgood•6m ago•0 comments

Midjourney Is Alemwjsl

https://www.aadillpickle.com/blog/midjourney-is-alemwjsl
1•aadillpickle•12m ago•0 comments

Testing a 40M view/day meme-page ad network for b2c products (early case study)

https://findclout.com/marketing/
1•jonahbuilds•12m ago•1 comments

Canada DND scrambles to figure out how to mobilize and equip a citizens' army

https://www.cbc.ca/news/politics/army-mobilization-canada-troops-9.7009323
3•Teever•14m ago•0 comments

Something Ominous Is Happening in the AI Economy

https://www.theatlantic.com/economy/2025/12/nvidia-ai-financing-deals/685197/
1•zerosizedweasle•14m ago•0 comments

Undeciphered Writing Systems

https://en.wikipedia.org/wiki/Undeciphered_writing_systems
3•frozenseven•15m ago•0 comments

My experience with Lean 4 for general programming

https://quamserena.com/2025-12-10/my-experience-with-lean-4-for-general-programming
1•quamserena•18m ago•0 comments

How People Use AI Agents

https://www.perplexity.ai/hub/blog/how-people-use-ai-agents
1•gmays•20m ago•0 comments

Agency Is Eating the World

https://giansegato.com/essays/agency-is-eating-the-world
1•walterbell•20m ago•0 comments

Curiosity in Relationships

https://okaykoa.substack.com/p/curiosity-in-relationships
2•herbertl•21m ago•0 comments

Understanding Carriage

https://seths.blog/2025/12/understanding-carriage/
2•herbertl•26m ago•0 comments

From Llamas to Avocados: Meta's shifting AI strategy is causing confusion

https://www.cnbc.com/2025/12/09/meta-avocado-ai-strategy-issues.html
1•LopRabbit•28m ago•0 comments

Blue Origin Might Make Starship Obsolete

https://wlockett.medium.com/blue-origin-might-make-starship-obsolete-6bc011ae86d2
2•Zigurd•32m ago•0 comments

A differentially private framework for gaining insights into AI chatbot use

https://research.google/blog/a-differentially-private-framework-for-gaining-insights-into-ai-chat...
1•tzury•36m ago•0 comments

HTTP load generator, inspired by rakyll/hey with TUI animation

https://github.com/hatoo/oha
2•overflowy•39m ago•0 comments

Why no one talks about React2Shell?

https://elenacross7.medium.com/react2shell-my-droplet-joined-a-botnet-c4850b079515
9•skilldeliver•39m ago•4 comments

Mosquitoes found in Iceland for first time as climate crisis warms country

https://www.theguardian.com/environment/2025/oct/21/mosquitoes-found-iceland-first-time-climate-c...
2•LopRabbit•40m ago•0 comments

After years of resisting it, SpaceX now plans to go public. Why?

https://arstechnica.com/space/2025/12/after-years-of-resisting-it-spacex-now-plans-to-go-public-why/
3•vanburen•40m ago•1 comments

Nature's many attempts to evolve a Nostr

https://newsletter.squishy.computer/p/natures-many-attempts-to-evolve-a
1•fiatjaf•43m ago•0 comments

Scientists Uncover Why the World's Most Common Heart Drug Causes Muscle Pain

https://scitechdaily.com/scientists-finally-uncover-why-the-worlds-most-common-heart-drug-causes-...
1•bookofjoe•49m ago•0 comments

Disguised and in Danger: How a Nobel Peace Prize Winner Escaped Venezuela

https://www.wsj.com/world/americas/disguised-and-in-danger-how-a-nobel-peace-prize-winner-escaped...
5•JumpCrisscross•52m ago•1 comments

Show HN: I made a social media bot maker

https://makesocialbots.com
1•quadVision•55m ago•1 comments

The Logic of Cue

https://cuelang.org/docs/concept/the-logic-of-cue/
2•PaulHoule•55m ago•0 comments

The Seven-Minute Visit Cannot Understand a Human Body

https://markatwood.substack.com/p/the-seven-minute-visit-cannot-understand
1•coloneltcb•57m ago•0 comments

AI Is Breakin' the Law

https://buildcognitiveresonance.substack.com/p/ai-is-breakin-the-law
1•mgrayson•58m ago•0 comments