Import numpy as np import matplotlib.pyplot as plt from PIL import Image
![import numpy as np
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw, ImageFont
# Set up the canvas size
width, height = 800, 600
image = Image.new('RGB', (width, height), (135, 206, 250)) # Sky blue background
draw = ImageDraw.Draw(image)
# Define the colors
roof_color = (139, 69, 19) # Brown
wall_color = (255, 228, 196) # Beige
window_color = (0, 0, 0) # Black
door_color = (139, 69, 19) # Brown
snow_color = (255, 250, 250) # White
tree_color = (34, 139, 34) # Forest green
dragon_color = (250, 128, 114) # Salmon
# Define the house dimensions
house_width = 300
house_height = 200
roof_height = 100
# Define the landscape
landscape_height = 200
tree_width = 50
tree_height = 100
tree_count = 10
# Draw the landscape
draw.rectangle((0, height - landscape_height, width, height), fill=(34, 139, 34))
# Draw the snow
draw.rectangle((0, height - landscape_height, width, height), fill=snow_color)
# Draw the trees
for i in range(tree_count):
tree_x = np.random.randint(tree_width, width - tree_width)
tree_y = height - landscape_height + np.random.randint(0, landscape_height - tree_height)
draw.rectangle((tree_x, tree_y, tree_x + tree_width, tree_y + tree_height), fill=tree_color)
# Draw the house
house_x = (width - house_width) // 2
house_y = height - landscape_height - house_height
draw.rectangle((house_x, house_y, house_x + house_width, house_y + house_height), fill=wall_color)
# Draw the roof
roof_points = [(house_x, house_y),
(house_x + house_width // 2, house_y - roof_height),
(house_x + house_width, house_y)]
draw.polygon(roof_points, fill=roof_color)
# Draw the windows
window_width = 50
window_height = 50
window_spacing = 50
for x in range(house_x + window_spacing, house_x + house_width - window_spacing, window_spacing):
for y in range(house_y + window_spacing, house_y + house_height - window_spacing, window_spacing):
draw.rectangle((x, y, x + window_width, y + window_height), fill=windo](https://image.cdn2.seaart.me/2024-08-20/cr2f6vle878c73a36it0/fd6d1245dcfcedde35ba5c746cce4986_high.webp)
import numpy as np import matplotlib.pyplot as plt from PIL import Image, ImageDraw, ImageFont # Set up the canvas size width, height = 800, 600 image = Image.new('RGB', (width, height), (135, 206, 250)) # Sky blue background draw = ImageDraw.Draw(image) # Define the colors roof_color = (139, 69, 19) # Brown wall_color = (255, 228, 196) # Beige window_color = (0, 0, 0) # Black door_color = (139, 69, 19) # Brown snow_color = (255, 250, 250) # White tree_color = (34, 139, 34) # Forest green dragon_color = (250, 128, 114) # Salmon # Define the house dimensions house_width = 300 house_height = 200 roof_height = 100 # Define the landscape landscape_height = 200 tree_width = 50 tree_height = 100 tree_count = 10 # Draw the landscape draw.rectangle((0, height - landscape_height, width, height), fill=(34, 139, 34)) # Draw the snow draw.rectangle((0, height - landscape_height, width, height), fill=snow_color) # Draw the trees for i in range(tree_count): tree_x = np.random.randint(tree_width, width - tree_width) tree_y = height - landscape_height + np.random.randint(0, landscape_height - tree_height) draw.rectangle((tree_x, tree_y, tree_x + tree_width, tree_y + tree_height), fill=tree_color) # Draw the house house_x = (width - house_width) // 2 house_y = height - landscape_height - house_height draw.rectangle((house_x, house_y, house_x + house_width, house_y + house_height), fill=wall_color) # Draw the roof roof_points = [(house_x, house_y), (house_x + house_width // 2, house_y - roof_height), (house_x + house_width, house_y)] draw.polygon(roof_points, fill=roof_color) # Draw the windows window_width = 50 window_height = 50 window_spacing = 50 for x in range(house_x + window_spacing, house_x + house_width - window_spacing, window_spacing): for y in range(house_y + window_spacing, house_y + house_height - window_spacing, window_spacing): draw.rectangle((x, y, x + window_width, y + window_height), fill=windo
提示词
复制
import numpy as np
import matplotlib
.
pyplot as plt
from PIL import Image
,
ImageDraw
,
ImageFont
# Set up the canvas size
width
,
height = 800
,
600
image = Image
.
new('RGB'
,
(width
,
height)
,
(135
,
206
,
250)) # Sky blue background
draw = ImageDraw
.
Draw(image)
# Define the colors
roof_color = (139
,
69
,
19) # Brown
wall_color = (255
,
228
,
196) # Beige
window_color = (0
,
0
,
0) # Black
door_color = (139
,
69
,
19) # Brown
snow_color = (255
,
250
,
250) # White
tree_color = (34
,
139
,
34) # Forest green
dragon_color = (250
,
128
,
114) # Salmon
# Define the house dimensions
house_width = 300
house_height = 200
roof_height = 100
# Define the landscape
landscape_height = 200
tree_width = 50
tree_height = 100
tree_count = 10
# Draw the landscape
draw
.
rectangle((0
,
height - landscape_height
,
width
,
height)
,
fill=(34
,
139
,
34))
# Draw the snow
draw
.
rectangle((0
,
height - landscape_height
,
width
,
height)
,
fill=snow_color)
# Draw the trees
for i in range(tree_count):
tree_x = np
.
random
.
randint(tree_width
,
width - tree_width)
tree_y = height - landscape_height + np
.
random
.
randint(0
,
landscape_height - tree_height)
draw
.
rectangle((tree_x
,
tree_y
,
tree_x + tree_width
,
tree_y + tree_height)
,
fill=tree_color)
# Draw the house
house_x = (width - house_width) // 2
house_y = height - landscape_height - house_height
draw
.
rectangle((house_x
,
house_y
,
house_x + house_width
,
house_y + house_height)
,
fill=wall_color)
# Draw the roof
roof_points = [(house_x
,
house_y)
,
(house_x + house_width // 2
,
house_y - roof_height)
,
(house_x + house_width
,
house_y)]
draw
.
polygon(roof_points
,
fill=roof_color)
# Draw the windows
window_width = 50
window_height = 50
window_spacing = 50
for x in range(house_x + window_spacing
,
house_x + house_width - window_spacing
,
window_spacing):
for y in range(house_y + window_spacing
,
house_y + house_height - window_spacing
,
window_spacing):
draw
.
rectangle((x
,
y
,
x + window_width
,
y + window_height)
,
fill=windo
信息
模型 & 风格

模型
SeaArt Infinity
#卡通
#福瑞
#SeaArt Infinity
共 0 条评论
0
1
0