When I look at the line tags in the Json file in instanceURL, a completely white blank screen appears and each detail appears in separate links. How can I print this data and what do I need to do to convert it to png?
Hi @bahadir.kulavuz ,
You can save those mask (instanceURL
) in PNGs if you want to vectorize those image you can use PIL to do so :
For example :
from PIL import Image
def vectorize_image(input_path, output_path, threshold=128):
# Open the PNG image
img = Image.open(input_path).convert('L') # Convert to grayscale
# Apply a threshold to create a binary image
binary_img = img.point(lambda x: 0 if x < threshold else 255, '1')
# Save the binary image as SVG
binary_img.save(output_path, format='SVG')
# Example usage
input_image_path = 'path/to/your/image.png'
output_svg_path = 'path/to/your/output.svg'
vectorize_image(input_image_path, output_svg_path)
Many thanks,
PT