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

Function medianCutQuantization

web/js/main.js:452–460  ·  view source on GitHub ↗
(imageData, colorCount)

Source from the content-addressed store, hash-verified

450}
451
452function medianCutQuantization(imageData, colorCount) {
453 // Simplified version for brevity, keeping the core logic from original
454 const pixels = [];
455 for (let i=0; i<imageData.data.length; i+=4) {
456 pixels.push([imageData.data[i], imageData.data[i+1], imageData.data[i+2], imageData.data[i+3]]);
457 }
458 // ... (Median cut implementation would go here, reusing the logic from original main.js)
459 // For now, let's keep the original median cut logic to ensure functionality
460}
461
462// Re-importing the Median Cut logic from original main.js to ensure it works
463class ColorBox {

Callers 1

processImageFunction · 0.85

Calls 3

quantizeToFixedPaletteFunction · 0.85
splitMethod · 0.45
getAverageColorMethod · 0.45

Tested by

no test coverage detected