2

I'm working on a pixel sprite and I have 2 coloured pixels with 1 empty pixel gap between them. Is there any way (tool) to fill in the missing pixel with the mixture of the 2 that are filled?

3
  • 5
    What software are you working in?
    – Vincent
    Commented Jan 8, 2016 at 11:00
  • For blending colors I like chroma.js a lot: vis4.net/labs/multihue/… Maybe this helps in your case, too...
    – AAGD
    Commented Jan 8, 2016 at 11:54
  • 1
    The result in general depends on your color space. Taking the average RGB value will not give you the same color as taking the average HSV color.
    – MSalters
    Commented Jan 8, 2016 at 15:19

1 Answer 1

1

Finding the exact colour code might depend on your current colour space, as mentioned in the comments. This method is colour-space agnostic and whould work in most software that supports layers.

  1. Draw a pixel of colour A on a new layer;
  2. Add a second layer on top of that, and draw a pixel of colour B exactly on top of pixel A;
  3. Reduce layer B's opacity to 50%;
  4. Merge the two layers;
  5. Sample the resulting pixel's colour. That is the colour you are looking for.

Alternatively, you could also draw directly over pixel A in layer A with a 50% opaque brush in colour B to get the same effect. Faster, but less intuitive.

2
  • Err, now the color that is dependent on color model is the median value. Color has a good enough definition to actually have a median color. Easiest way to compute this though is to work in a device independent colorspace. Also nitpicky but you havent actually computed the median but the average.
    – joojaa
    Commented Dec 18, 2017 at 15:47
  • @joojaa shrug This works 😊
    – Vincent
    Commented Dec 19, 2017 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.