I would be looking into using the <canvas> tag if I was trying to build this from scratch.
The first task is to figure out out how to draw lines to your satisfaction. For example, there is a built in lineTo() function as part of the canvas api:
let c = document.getElementById("myCanvas");
let ctx = c.getContext("2d");
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(300, 150);
ctx.lineWidth = 5;
ctx.stroke();
I just grabbed this from this site.
To do this the Ionic way though you would need to get the native element using perhaps this tutorial.
That tutorial shows how to do both getting the canvas in Ionic and drawing lines.
Add a canvas tag like this:
<canvas #imageCanvas></canvas>
Get it from the code by using a viewchild like this:
@ViewChild('imageCanvas') canvas: any;
And then read its nativeElement like this:
this.canvasElement = this.canvas.nativeElement;
After that you can use the lineTo code from above. In fact, if you read that tutorial it uses the same technique to draw lots of little lines to look like a mouse drawing mode.
And if you position the image using css absolute positioning above the canvas it will work as a background image, I think by default, but I'm pretty sure you can make the canvas bg transparent.