SShortSingh.
Back to feed

Recoloring One Image Region While Preserving Its Shading

0
·1 views

A global hue slider changes too much when only one part of an image should be recolored, such as an icon, logo, or flat background. The described method starts from a clicked seed pixel and grows a selection through 8-connected neighbors whose color and alpha fall within set tolerances. A second, looser pass captures anti-aliased edge pixels adjacent to the selection without leaking into distant areas. To keep highlights and shadows intact, the new color is scaled per pixel by luminance relative to the region's dominant base brightness, with alpha left unchanged. The approach is implemented in the recolor-region package, which works on raw RGBA bytes with no dependencies.

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
ProgrammingHacker News ·

Stripe to acquire OpenRouter for $7.5 billion

Payments company Stripe has reportedly agreed to acquire OpenRouter, a platform that routes traffic between AI models, in a deal valued at $7.5 billion. The information comes from a Startup Fortune report, which describes OpenRouter as a kind of traffic cop for AI model requests. The source material available here is limited to the headline and link, so details on deal terms, timing, and strategic rationale could not be independently confirmed. Discussion of the report on Hacker News drew modest attention at the time of sourcing.

0
ProgrammingHacker News ·

Qwen3-4B fine-tuned to suppress common AI writing patterns, shared on Hacker News

A developer has released a version of the Qwen3-4B language model that has been trained to reduce the stylistic habits typical of AI-generated text. The project was posted to Hacker News as a Show HN submission, linking to a write-up on the 100toolkit.com blog. The post drew 14 points and 3 comments from the community. The available source does not detail the training method, evaluation results, or the specific writing tics targeted.

0
ProgrammingHacker News ·

Poll Finds Most Americans Oppose Live-Streaming Executions

A Washington Post poll reports that roughly eight in ten Americans oppose broadcasting executions live. The question was raised in connection with the case of the Fort Hood shooter, whose potential execution has drawn public attention. The survey indicates broad public discomfort with turning capital punishment into a live spectacle. The findings were first highlighted on Hacker News, where the article gained modest attention. Details beyond the headline poll figure are limited in the available source material.

0
ProgrammingDEV Community ·

Persona Lines in AI Instruction Files Correlate With Lower Quality Scores

A study of the 10,000 most-starred repositories found 285 main AI instruction files, such as CLAUDE.md and AGENTS.md, that open with a 'You are a...' persona line. On the ails check 0 to 10 scale, these files had a median score of 6.6, compared with 7.7 for the other 20,551 main files. The gap persisted across all four file-size groups, ranging from 0.9 to 1.25 points. The analysis attributes the difference to the rest of the file: persona files devote more lines to instructions, and their prohibitions are more often written as strong 'never' statements without matching permissions, hedged, or weakly ordered. The author suggests replacing persona lines with specific, tool-named directives.