_update(data, width, height, channels = null) {
        this.data = data;
        this.width = width;
        this.height = height;
        if (channels !== null) {
            this.channels = channels;
        }
        return this;
    }
Helper method to update the image data.
@param {Uint8ClampedArray} data The new image data.
@param {number} width The new width of the image.
@param {number} height The new height of the image.
@param {1|2|3|4|null} [channels] The new number of channels of the image.
@private