![]() ![]() fonts, and call it with create_testing_images(, 'fonts/金文大篆体.ttf', save_to_folder='test') Where the core snippet is font = uetype(font_path,font_size)įor example, if you put those fonts in the folder. Img.save(os.path.join(sub_folder_full, char) + '.gif') Img_array = grey2binary(img_array, white_value=255)Įdge_top = img_arrayĮdge_left = img_arrayĮdge_bottom = img_arrayĮdge_right = img_arrayĬriterion = sum(itertools.chain(edge_top, edge_left, Img = img.resize((image_size, image_size), resample=Image.BILINEAR) Img = Image.new('L',(font_size,font_size),'white') Sub_folder_full = os.path.join(save_to_folder, sub_folder)įont = uetype(font_path,font_size)īg = Image.new('L',(font_size,font_size),'white') Sub_folder = os.path.splitext(sub_folder) Here is my Python script: import numpy as npįrom PIL import Image, ImageFont, ImageDraw, ImageChops Below are the appearances in Microsoft Word I have three true type fonts for this task ( Jin_Wen_Da_Zhuan_Ti.7z, Zhong_Guo_Long_Jin_Shi_Zhuan.7z, Zhong_Yan_Yuan_Jin_Wen.7z, for testing purpose only). I am creating images of Chinese seal script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |