MCPcopy Create free account
hub / github.com/32comic/image2pixel-web / colorDistance

Method colorDistance

pixelizer.js:805–812  ·  view source on GitHub ↗
(color1, color2)

Source from the content-addressed store, hash-verified

803 }
804
805 colorDistance(color1, color2) {
806 return Math.sqrt(
807 Math.pow(color1[0] - color2[0], 2) +
808 Math.pow(color1[1] - color2[1], 2) +
809 Math.pow(color1[2] - color2[2], 2) +
810 Math.pow(color1[3] - color2[3], 2)
811 );
812 }
813
814 applyFloydSteinbergDithering(imageData, colorCount) {
815 // Floyd-Steinberg抖动实现

Callers 1

medianCutQuantizationMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected