Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.6 kB
2
Indexable
Never
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw, ImageFont
import numpy as np

# Create an empty white canvas
width, height = 800, 400
background_color = (255, 255, 255)
canvas = Image.new('RGB', (width, height), background_color)
draw = ImageDraw.Draw(canvas)

# Define font size and type
try:
    font = ImageFont.truetype("arial.ttf", 80)
except IOError:
    font = ImageFont.load_default()

# Add text to the canvas
text = "GREEN FINDS"
text_color = (34, 139, 34)  # forest green color
text_position = (100, 150)
draw.text(text_position, text, fill=text_color, font=font)

# Add nature themed elements: vines, leaves, trees
# Create some simple leaves and vines using polygons and lines
leaf_color = (34, 139, 34)
vine_color = (0, 100, 0)

# Draw some vines
for i in range(5):
    start_pos = (100 + i * 140, 150)
    end_pos = (150 + i * 140, 50)
    draw.line([start_pos, end_pos], fill=vine_color, width=5)
    # Draw leaves
    leaf_points = [(150 + i * 140, 50), (160 + i * 140, 40), (140 + i * 140, 40)]
    draw.polygon(leaf_points, fill=leaf_color)

# Draw a tree on the left side
tree_trunk_color = (139, 69, 19)
tree_trunk_points = [(80, 300), (100, 300), (90, 200)]
draw.polygon(tree_trunk_points, fill=tree_trunk_color)

tree_foliage_color = (34, 139, 34)
tree_foliage_points = [(60, 200), (90, 100), (120, 200)]
draw.polygon(tree_foliage_points, fill=tree_foliage_color)

# Convert to numpy array for displaying
canvas_array = np.array(canvas)

# Display the logo
plt.figure(figsize=(10, 5))
plt.imshow(canvas_array)
plt.axis('off')
plt.show()
Leave a Comment