Create the 3D printing file (Geometry) from colour image

As shown in the figure, the generated entity structure is composed of many cubes.
Can it be in the form shown in the figure below?

There is another question.
When I set the size of grid cells in square to 0.1 and the number of grid cells in base plane X direction to 500, the program will die.