baffler
177 posts

baffler
@baffler
programmer | rigging for 3d models (I do not create/design models) | author of Transparent Twitch Chat Overlay app | maintainer of OpenVR OBS plugin












The new @zentreya tts subtitle update is incredible where it can highlights the names from the chat and the emotes too, @baffler you are a genius, never stop cooking. 🧑🍳 #zentreya #zentreClip #vtuberClip



🔴🟢🔵 ~Colour Palette from Texture~ -- Extracting colour information from an image: 🔢 Downsample and/or quantize to reduce noise and increase performance. You can get a roughly approximated palette from this step alone. 🔑 Hash/key pixels by their quantized integer colour like you'd hash a particle into XYZ spatial bins. This will let me easily group and count similar colours. 💡 I can apply a separable quantization filter if I hash in HSV space (hue, saturation, and value). So I can pre-filter the image pixels by posterized channels for colour (light wavelength), purity, and amplitude. For example, I could force hues into 32 bands, saturation into 16, and values into 97 if I feel like it. 📊 You now have a histogram of colour occurrence frequencies which can be ordered and filtered to get a list of dominant pixels (RGB). That is, you have a dictionary/list/set of all the colours, and the integer count of how many times they appeared. 👁️ Filtering can be based on distances in RGB, HSV, and luminance spaces to enforce a minimum perceptual difference between palette colours. This prevents shades of the same colour from oversaturating the palette, without needing to crush and lose too much detail from the initial quantization step(s). > Exposing as parameters lets me tweak and extract gradients on the fly, in realtime. #gamedev #indiedev











