You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you very much for open-sourcing this amazing library! I am trying to convert the outline of a simple image to a .pes file. For example, if I take a simple image of a dog, I am trying to detect the edges first and then convert the filtered image to a .pes file. If the problem is that I am trying to stitch only the edges, then I could use a fill-in stitch as well. This is the code that I am using, but the image appears with too many stitches all over the place (that do resemble the initial image in some sense):
def convert_image_to_pes(image_array, pes_file):
# Create a new pattern
pattern = pyembroidery.EmbPattern()
# Iterate over the image array and add stitches
height, width = image_array.shape
for y in range(height):
for x in range(width):
if image_array[y, x] != 0:
# Add a stitch at the current position with default color (black)
pattern.add_stitch_absolute(pyembroidery.STITCH, x, y)
# Save the pattern to a PES file
pattern.write(pes_file)
print("Conversion successful!")
convert_image_to_pes(edges3, 'output.pes')
Do you maybe have any recommendations?
Cheers,
Georgia :)
The text was updated successfully, but these errors were encountered:
Filling in an area should likely be done with a much more advanced algorithm. For example, Eulerian Fill, which is a lot easier than something like Tatsumi.
Hello,
Thank you very much for open-sourcing this amazing library! I am trying to convert the outline of a simple image to a .pes file. For example, if I take a simple image of a dog, I am trying to detect the edges first and then convert the filtered image to a .pes file. If the problem is that I am trying to stitch only the edges, then I could use a fill-in stitch as well. This is the code that I am using, but the image appears with too many stitches all over the place (that do resemble the initial image in some sense):
def convert_image_to_pes(image_array, pes_file):
# Create a new pattern
pattern = pyembroidery.EmbPattern()
convert_image_to_pes(edges3, 'output.pes')
Do you maybe have any recommendations?
Cheers,
Georgia :)
The text was updated successfully, but these errors were encountered: