How can I generate coordinates (points) of equal distance from each other along a given path (e.g a black line in an image)

I need to be able to obtain X and Y coordinated of a path, from an image, shape, and userdrawn paths.

If possible, I would like to do the same in 3D, obtaining the Z axis as well.

Any suggestions? I have tried to use matlab for this, but I am stuck, any help is greatly appreciated.

Below is an example of points that trace the following image: I would like to be able to generate similar points, but for any image/path.

let drawing = [
  { x: -75.23920093800275, y: -9.276916512631997 },
  { x: -73.99534065831229, y: -9.582732689485699 },
  { x: -72.74106439694725, y: -9.89162195029445 },
  { x: -71.4876893765498, y: -10.200732827734575 },
  { x: -70.23509740158319, y: -10.510035772921889 },
  { x: -68.98192922337502, y: -10.820003568003328 },
  { x: -67.72920427842959, y: -11.130281626368685 },
  { x: -66.47577016026378, y: -11.44115066241771 },
  { x: -65.22337025304437, y: -11.752211766213923 },
  { x: -63.97037936814129, y: -12.063908171020076 },
  { x: -62.718127205342796, y: -12.376092132415248 },
  { x: -61.46532838818692, y: -12.689014815915003 },
  { x: -60.21245569882057, y: -13.002602349308878 },
  { x: -58.96055812263228, y: -13.316706988175959 },
  { x: -57.708867388633266, y: -13.631609446915984 },
  { x: -56.45698458688706, y: -13.947679086581244 },
  { x: -55.205279078445955, y: -14.26490113272965 },
  { x: -53.95457823206708, y: -14.583246036477012 },
  { x: -52.703685317941016, y: -14.903703685443475 },
  { x: -51.4546244346343, y: -15.226096786323936 },
  { x: -50.20482482922301, y: -15.552168723285197 },
  { x: -48.95740390898846, y: -15.881313744201512 },
  { x: -47.70490058067441, y: -16.19289195347093 },
  { x: -46.448230859690526, y: -16.486223726757242 },
  { x: -45.188059595930945, y: -16.76634714881368 },
  { x: -43.92584945916273, y: -17.036571694668755 },
  { x: -42.66235394593253, y: -17.29898056065738 },
  { x: -41.39749918402992, y: -17.555272807620092 },
  { x: -40.131196526802334, y: -17.806852007555587 },
  { x: -38.863977854165064, y: -18.05438301035799 },
  { x: -37.596847828180344, y: -18.298604538131876 },
  { x: -36.32874268901758, y: -18.540255312981827 },
  { x: -35.0599579255186, y: -18.77966037263386 },
  { x: -33.79075947764106, y: -19.017455018097905 },

there are 5000 points, this only some of them..

The closed loop path