From 429d88c46177c97f597f8e84dd407bf495e3433e Mon Sep 17 00:00:00 2001 From: yongsky02 <155448277+yongsky02@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:29:31 +0700 Subject: [PATCH] Create hoshi airdrop hoshi airdrop --- hoshi airdrop | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 hoshi airdrop diff --git a/hoshi airdrop b/hoshi airdrop new file mode 100644 index 00000000000..8d31d4bdcb1 --- /dev/null +++ b/hoshi airdrop @@ -0,0 +1,30 @@ +from PIL import ImageDraw, ImageFont + +# Load the provided star logo image +star_logo_path = "/mnt/data/image.png" +star_logo_image = Image.open(star_logo_path) + +# Define the text to add and its properties +text = "Hoshi" +font_size = 50 # Adjust the font size as needed + +# Load a font (using a default one since no specific font is provided) +try: + font = ImageFont.truetype("arial.ttf", font_size) +except IOError: + font = ImageFont.load_default() + +# Get image size and define text position +image_width, image_height = star_logo_image.size +draw = ImageDraw.Draw(star_logo_image) +text_width, text_height = draw.textsize(text, font=font) +text_position = ((image_width - text_width) // 2, image_height - text_height - 20) # 20 pixels above the bottom + +# Add the text to the image +draw.text(text_position, text, font=font, fill="white") + +# Save the modified image +modified_image_path = "/mnt/data/star_logo_with_text.png" +star_logo_image.save(modified_image_path) + +modified_image_path