function isCanvasEqual(value, other) {
if (value.width !== other.width || value.height !== other.height) {
return false;
}
const valueImageData = value
.getContext('2d')
.getImageData(0, 0, value.width, value.height).data;
const otherImageData = other
.getContext('2d')
.getImageData(0, 0, other.width, other.height).data;
for (let i = 0; i < valueImageData.length; i += 1) {
if (valueImageData[i] !== otherImageData[i]) {
return false;
}
}
return true;
}