chirunavvula chindu
chirunavvula chindu

Reputation: 11

How to convert .dst file to .jpg format using python?

I have a lot of .dst files. I have to convert all files into .jpg. I tried with pyembroidery module in python, but I don't know how to save the conversion file. Can anyone please help me.

Upvotes: 1

Views: 561

Answers (2)

chindu prasath
chindu prasath

Reputation: 11

Using below method you can convert .dst into png format files. You can also read .dst/.jpg/.pes files by using their commands. Recently, I developed simple application that can convert multiple embroidery files into images and save in particular folder.

import pyembroidery

filepath=r'C://Users//Desktop//file.DST'

pattern=pyembroidery.read_dst(filepath)

var=pyembroidery.write_png(pattern, 'C://Users//Desktop//filename.jpg')

print(pattern)

print(var)

Upvotes: 1

Jayesh Marvadi
Jayesh Marvadi

Reputation: 3

  1. Import the Image module from PIL the os module.
  2. Import the image to be converted using the Image.open() method.
  3. Display the size of the image before the conversion using the os.path.getsize() method.
  4. Convert the image using the Image.convert() method. Pass "RGB" as the parameter.
  5. Export the image using the Image.save() method.
  6. Display the size of the image after the conversion using the os.path.getsize() method.

Upvotes: 0

Related Questions