Skip to main content

All Questions

Tagged with
0 votes
0 answers
31 views

Normal blend mode math

I have one question. How to calculate source color after blending operation. For example. I have 1 - Background color (r-115, g-94, b-67, a-1) 2 - Foreground color above background color, which ...
Alisher's user avatar
4 votes
1 answer
344 views

How to find the nearest palette color when dithering in RGB

I maintain an image dithering library and command line tool. When I was initially developing the library, I was trying to figure out how to match dithered RGB values (containing quantization error or ...
makeworld's user avatar
  • 143
3 votes
1 answer
221 views

Tiled Image Palettization Algorithm?

In most cases today, image palettization consists of reducing the overall number of colors in an image to some fixed number globally. This is typically solved as a straightforward but computationally ...
Justin Olbrantz's user avatar
4 votes
1 answer
474 views

How to shift color values of a single RGB channel

I’m a weaver and textile maker with no prior coding or programming experience. In researching and reading through posts on this and other message boards, I was able to find a lot of useful information,...
T Frank's user avatar
  • 43
0 votes
1 answer
131 views

Quick 2-color quantization for small images

So I have a small (8x8 pixel) image in 24-bit color. I want to be able to (quickly) generate a color-quantized version of the image that only has two colors. One naive approach is to cluster a luma ...
AnimatedRNG's user avatar
3 votes
1 answer
567 views

Can someone explain this formula for parse RGB to HSL?

Im trying to complain the algorithm to calculate the HSL value form a RGB color. I understand the algorithm for the Hue, but im lost with the Lightness and saturation. Someone can explain why? There ...
TheRedosan's user avatar
6 votes
2 answers
1k views

Color transform algorithm (that also works on saturation and value/lightness)?

To change particular colors in an image, generally you multiply the RGB by a transformation matrix. Image manipulation programs such as gimp & photoshop have a selective color change function that ...
Escher's user avatar
  • 423
9 votes
1 answer
5k views

Understanding Jump Flooding Algorithm (JFA) for Voronoi Diagrams

I'm having trouble understanding the JFA. As far as I understood the algorithm, it walks log(n) times through every pixel (no matter if it is a seed or not) and looks at that pixel's neighbors in $(x+...
Muad's user avatar
  • 165
5 votes
1 answer
2k views

Is there a way to interpolate color across the line with only integer calculation ?`

Here is my function that does interpolation ...
user avatar
8 votes
2 answers
344 views

How can I detect edges between different colours of the same brightness?

I'm looking for an algorithm that can identify edges across which colour is changing sharply, rather than just finding changes in brightness. Is this just a matter of using a different colour space ...
trichoplax is on Codidact now's user avatar