// jQuery
$(document).ready(function() {
// code
})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var canvasimage = document.createElement('img'); | |
| canvasimage.crossOrigin = "Anonymous"; | |
| canvasimage.setAttribute('src', image) | |
| canvasimage.addEventListener('load', function () { | |
| const canvas = document.createElement('canvas'); | |
| const size = 16; | |
| const maxPaletteSize = 10; | |
| const context = canvas.getContext('2d'); | |
| const pixelArray = []; // Contains arrays of [red, green, blue, freqency] | |
| const palette = []; // Contains arrays of [red, green, blue] |