function getSprite(p, size = 256) {
let columns = 33
let canvas = document.createElement('canvas');
let ctx = canvas.getContext('2d');
canvas.width = size;
canvas.height = size;
let index = pokemon.indexOf(p);
let x = (index % columns) * size;
let y = Math.floor(index / columns) * size;
ctx.drawImage(size == 256 ? all256 : all64, x, y, size, size, 0, 0, size, size);
let img = new Image();
img.src = canvas.toDataURL();
return img;
}