Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create hoshi airdrop #12029

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions hoshi airdrop
Original file line number Diff line number Diff line change
@@ -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