EmbroidePy / pyembroidery

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

png to dst #53

Closed sangramrajekakade closed 5 years ago

tatarize commented 5 years ago

PNG files are raster based files, they contain compressed information about the scanline of a image file. DST files contain command codes for a command for an embroidery machine to follow. There's no direct way to convert these types. You have to actually download software and create them as you would do a vector. This project was originally intended to help InkStitch which is such an opensource project. But, takes some actual skill to do such work effectively. It's a higher level function and as such is beyond the scope of this project.

sangramrajekakade commented 5 years ago

when i convert dst file to png every time ping color changing how? i am using pyembroidery

tatarize commented 5 years ago

The DST files don't have any color data. They are machine instructions for the embroidery machine, as such they have data for stopping the machine, moving to a new location and blocking the needle bar, moving to a new location and not blocking the needle bar. And sequins. But, DST files don't have any color data stored within them, so when you convert from DST to PNG it selects a random set of colors because PNG files have to have a color and the DST files do not have that data.

Here's the technical specs on the format you'll see nothing in them stores that data.

There is an option for extended header called "extended header" which you could set to True, but that would be for saving the DST, and would save the color data but would sacrifice compatibility on some embroidery machines. Already made DST files don't have colors in them.

wwderw commented 5 years ago

This is why we (digitizers) send out "stitch charts" with DST files. Because each time those files are opened, it will show a slightly different color.

Even if the file did retain the color info (say PES format), still can manipulate what color is used for what "color" block at the machine. Color info in of itself is not really set in stone even with files that support origin design color.