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

Method quantizeColors

pixelizer.js:737–745  ·  view source on GitHub ↗
(imageData, colorCount, enableDithering)

Source from the content-addressed store, hash-verified

735 }
736
737 async quantizeColors(imageData, colorCount, enableDithering) {
738 // 使用现有的median cut算法
739 this.medianCutQuantization(imageData, colorCount);
740
741 // 如果启用抖动,应用Floyd-Steinberg抖动
742 if (enableDithering) {
743 this.applyFloydSteinbergDithering(imageData, colorCount);
744 }
745 }
746
747 // 复用existing的medianCutQuantization方法
748 medianCutQuantization(imageData, colorCount) {

Callers 1

Calls 2

medianCutQuantizationMethod · 0.95

Tested by

no test coverage detected