"gtin:04620757979006"
Код: Выделить всё
draw = ImageDraw.Draw(picture)
# Store font for the texts
font = ImageFont.truetype(r"C:\Users\user\PycharmProjects\pythonProject\arial.ttf", 12)
# Draw texts on the Picture
datamatrix_text_position_px = (25, 115)
draw.text(datamatrix_text_position_px, text=gtin, fill = 'black', font = font)
# Save the image
picture.save("datamatrix.png")
gtin = "04620757979006"
Код: Выделить всё
draw.text(datamatrix_text_position_px, text="gtin:" str(gtin), fill = 'black', font = font)
введите здесь описание изображения
Код: Выделить всё
picture.save("datamatrix.png", dpi=(300, 300)) it resize all image to small
но в любом случае получаю ошибку. Например:
Код: Выделить всё
draw.text(datamatrix_text_position_px, text="gtin:" str(gtin), fill = 'black', font = font)
введите здесь описание изображения
Код: Выделить всё
picture.save("datamatrix.png", dpi=(300, 300)) it resize all image to small
Подробнее здесь: https://stackoverflow.com/questions/786 ... resolution