function restoreOriginal(targetImage, columns, colStart, colEnd) {
const {inputData32, inputEnd} = carved;
const {context, output32, output} = targetImage;
for (let y = 0; y < height; y++) {
const line = y * width;
let x = 0;
for (let i = colStart; i < colEnd; i++) {
const xEnd = columns[i + line];
const rgba = inputData32[i + line];
while(x < xEnd) {
output32[x + line] = rgba;
x++;
}
}
const rgba = inputData32[inputEnd + line];
while (x < width) {
output32[x + line] = rgba;
x++;
}
}
context.putImageData(output, 0, 0);
}