PathFinding this kind of pathfinding algorithm framework, how to generate the matrix needed?

I would like to ask you guys, in game development, characters find their way in maps. In the framework of pathfinding algorithms like PathFinding.js, the map matrix needed is generated immediately during the pathfinding operation, or corresponding to the map generated in advance

.
var matrix = [
    [0, 0, 0, 1, 0],
    [1, 0, 0, 0, 1],
    [0, 0, 1, 0, 0],
];
var grid = new PF.Grid(matrix);

if it is generated in advance, how is this matrix generated? is there any tool, such as opening a map picture, drawing a movable area, and then automatically generating the corresponding matrix file?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e49a92-44d2d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e49a92-44d2d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?