imageDataToCanvas(imageData, w, h) 
	{
		// console.log(raws, x, y)
		const arr = Array.from(imageData)
		const canvas = document.createElement('canvas'); // Consider using offScreenCanvas when it is ready?
		const ctx = canvas.getContext('2d');

		canvas.width = w;
		canvas.height = h;

		const imgData = ctx.createImageData(w, h);
		// console.log(imgData)
		const { data } = imgData;

		for (let i = 0; i < w * h * 4; i += 1 ) data[i] = arr[i];
		ctx.putImageData(imgData, 0, 0);

		return ctx.canvas;
	}
/* 
    * Turn the segmented imag to a canva image
	* @imageData: image data to transform to canvas
	* @w: width of canvas to put the image on
	* @h: height of the canvas to put the image on
    */
Turn the segmented imag to a canva image
@imageData: image data to transform to canvas
@w: width of canvas to put the image on
@h: height of the canvas to put the image on
Turn the segmented imag to a canva image @imageData : image data to transform to canvas @w : width of canvas to put the image on @h : height of the canvas to put the image on
imageDataToCanvas(imageData, w, h) 
	{
		const arr = Array.from(imageData)
		const canvas = document.createElement('canvas'); 
		const ctx = canvas.getContext('2d');
		canvas.width = w;
		canvas.height = h;
		const imgData = ctx.createImageData(w, h);
		const { data } = imgData;
		for (let i = 0; i < w * h * 4; i += 1 ) data[i] = arr[i];
		ctx.putImageData(imgData, 0, 0);
		return ctx.canvas;
	}
imageDataToCanvas ( imageData , w , h ) { const arr = Array . from ( imageData ) const canvas = document . createElement ( 'canvas' ) ; const ctx = canvas . getContext ( '2d' ) ; canvas . width = w ; canvas . height = h ; const imgData = ctx . createImageData ( w , h ) ; const { data } = imgData ; for ( let i = 0 ; i < w * h * 4 ; i += 1 ) data [ i ] = arr [ i ] ; ctx . putImageData ( imgData , 0 , 0 ) ; return ctx . canvas ; }
Turn the segmented imag to a canva image
 @imageData: image data to transform to canvas
 @w: width of canvas to put the image on
 @h: height of the canvas to put the image on
Turn the segmented imag to a canva image @imageData : image data to transform to canvas @w : width of canvas to put the image on @h : height of the canvas to put the image on
// console.log(raws, x, y) // Consider using offScreenCanvas when it is ready? // console.log(imgData)