EmbroidePy / pyembroidery

pyembroidery library for reading and writing a variety of embroidery formats.
MIT License
182 stars 33 forks source link

converted png does't get proper thread #56

Closed sangramrajekakade closed 5 years ago

sangramrajekakade commented 5 years ago

hello, I have convert .dst file to png but that png files threads(Stitching Point) are not getting properly how can i get proper png file (with proper stitching point)

tatarize commented 5 years ago

The dst files do not save thread data. They don't contain that information and as such, a bunch of random colors will be selected for the various thread data. In order to properly represent this data it would have to exist. There's a few formats that contain thread data and if one of them is used rather than .dst, then it should extract and use the thread data from those formats. Things like pes version 5+ or xxx or .sew has this data and pyembroidery will load it and use it to make the png accordingly. But, the dst files don't have that information and therefore it can't be recovered from the file.

See the technical specs for DST files here: https://edutechwiki.unige.ch/en/Embroidery_format_DST

They are commands sent to a CNC like machine and simply executed by the device. They don't know what color the thread is, just that they jab the needle into this location or whatnot.

sangramrajekakade commented 5 years ago

actually, when i convert png file it looks like normal image. i want that image like 3D thread(look like 3D png)

tatarize commented 5 years ago

How to render a bunch of lines to look like thread is outside the scope of this project. The point is to read and write a great many embroidery formats. How they are made to look after that isn't anything to do with preserving, reading or writing the information stored in those formats.

sangramrajekakade commented 5 years ago

there is any other options to look like proper png with proper thread

tatarize commented 5 years ago

You can take the actual stitch/point data and use a proper rendering package to make something that looks 3d. 3d rendering is a lot to do with threadlike textures, shading, light sources, various sizing constraints, etc. Pyembroidery is solely concerned with the IO. Reading the embroidery files and writing the embroidery files and trying to make sure those are as lossless as possible. The png export that exists is an afterthought.

How you display the information is beyond the scope of this project. The PNG export option that exists is mostly concerned with debugging. It was a request and there did exist a simply method to custom write a png file under acceptable licensing, so it was added.

One of the not so explicitly stated requirements is that this project does not require any other project. Properly 3d rendering is a complex subject and would require a bunch of different elements. The PNG export writer is entirely self-contained, it's literally just an implementation of writing a single type of PNG file and an implementation of bresenham's line draw algorithm.

The assumption is that if anybody is going to use this project for anything they'll likely do the information displaying themselves. This isn't really anything to do with that. It's just all the different embroidery formats and the ability to read and write them.