Urgent.News

What's breaking now, across thousands of outlets.

Tech

How We Built a 100% In-Browser Image to Bead Pattern Generator (CIE Lab Color Matching & Zero-Cost Architecture)

When converting user-uploaded photographs into physical fuse bead patterns (such as Perler, Hama, or Artkal beads) or retro 8-bit game sprites, most web services take the expensive path: upload the JPEG to a server, process it with OpenCV or ImageMagick in Python, and return a grid of hex codes. For BeadPattern , we wanted a completely different architecture: 100% client-side processing directly…

When converting user photos to bead patterns, most services use expensive server-side processing with OpenCV or ImageMagick. BeadPattern opted for a client-side solution, processing everything in the user's browser with no image transmission or server compute costs. The main challenges were accurate color matching, real-time rendering, and responsive mobile interaction.

Euclidean RGB distance was found to produce poor results for skin tones and pastels. Converting colors to CIE L*a*b* space addressed this issue, as it better aligns with human perception of light. This conversion pipeline improved bead color matching significantly.

Generating bead patterns with a 58x58 grid from high-resolution photos would require numerous distance calculations. To optimize performance, they precomputed L*a*b* vectors for the bead palette and used a K-d tree for efficient nearest neighbor searches. This reduced computational complexity from linear to logarithmic time. Finally, they implemented Floyd-Steinberg error diffusion to minimize color banding while downsampling photos to the 48-color bead palette.

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

Whatever You Say Bounces Off Me and Sticks to You

Stephen Nellis and Deepa Seetharaman, reporting Wednesday for Reuters: An OpenAI employee who left the ChatGPT maker for Apple sent more than 100 files about an unreleased product to a personal…

  • OpenAI accuses former employee of leaking confidential product details to Apple.
  • Employee allegedly shared over 100 files to personal account and presented to Apple leaders.
  • OpenAI's lawsuit cites Apple's HomeView product as evidence of AI development.

Lovable Supabase: Bring Your Own Project

Every new Lovable project gets Lovable Cloud by default, and Cloud is Supabase underneath. So "Lovable Supabase" means two different things depending on who's asking.

  • Connect your own Supabase project to Lovable Supabase easily.
  • Developer with edit access connects project via workspace link.
  • Connection process takes around ten minutes.

More from Sunday 18 October →