A close up of a man wearing a blue tie and white shirt
![# Re-create the image with a suit and convert it to a PDF
from PIL import Image, ImageDraw
# Load the original image again
image = Image.open(img_path)
# Define suit area and create a black suit shape
suit_shape = Image.new('RGB', (image.width, int(image.height / 2)), (0, 0, 0))
# Create white collar and red tie on the suit shape
draw = ImageDraw.Draw(suit_shape)
collar_width = int(image.width / 2)
collar_height = int(image.height / 10)
tie_width = int(image.width / 8)
tie_height = int(image.height / 3)
# Draw white collar
collar_start_x = int(image.width / 4)
collar_end_x = int(3 * image.width / 4)
collar_y = 0
draw.rectangle([collar_start_x, collar_y, collar_end_x, collar_height], fill=(255, 255, 255))
# Draw red tie
tie_start_x = int(image.width / 2 - tie_width / 2)
tie_end_x = int(image.width / 2 + tie_width / 2)
tie_start_y = collar_height
tie_end_y = tie_start_y + tie_height
draw.polygon([(tie_start_x, tie_start_y), (tie_end_x, tie_start_y), (image.width / 2, tie_end_y)], fill=(255, 0, 0))
# Combine the top half of the original image with the new suit shape
combined_image = Image.new('RGB', (image.width, image.height))
combined_image.paste(image.crop((0, 0, image.width, int(image.height / 2))), (0, 0))
combined_image.paste(suit_shape, (0, int(image.height / 2)))
# Save the image as a PDF
pdf_output_path = '/mnt/data/formal_profile_picture.pdf'
combined_image.save(pdf_output_path, "PDF", resolution=100.0)
pdf_output_path](https://image.cdn2.seaart.me/2024-06-03/cpf0lg5e878c73b5gh2g/2d7b9a8df94ec793d4b0f695099fc75427daab05_high.webp)
Prompts
Copy
# Re-create the image with a suit and convert it to a PDF
from PIL import Image
,
ImageDraw
# Load the original image again
image = Image
.
open(img_path)
# Define suit area and create a black suit shape
suit_shape = Image
.
new('RGB'
,
(image
.
width
,
int(image
.
height / 2))
,
(0
,
0
,
0))
# Create white collar and red tie on the suit shape
draw = ImageDraw
.
Draw(suit_shape)
collar_width = int(image
.
width / 2)
collar_height = int(image
.
height / 10)
tie_width = int(image
.
width / 8)
tie_height = int(image
.
height / 3)
# Draw white collar
collar_start_x = int(image
.
width / 4)
collar_end_x = int(3 * image
.
width / 4)
collar_y = 0
draw
.
rectangle([collar_start_x
,
collar_y
,
collar_end_x
,
collar_height]
,
fill=(255
,
255
,
255))
# Draw red tie
tie_start_x = int(image
.
width / 2 - tie_width / 2)
tie_end_x = int(image
.
width / 2 + tie_width / 2)
tie_start_y = collar_height
tie_end_y = tie_start_y + tie_height
draw
.
polygon([(tie_start_x
,
tie_start_y)
,
(tie_end_x
,
tie_start_y)
,
(image
.
width / 2
,
tie_end_y)]
,
fill=(255
,
0
,
0))
# Combine the top half of the original image with the new suit shape
combined_image = Image
.
new('RGB'
,
(image
.
width
,
image
.
height))
combined_image
.
paste(image
.
crop((0
,
0
,
image
.
width
,
int(image
.
height / 2)))
,
(0
,
0))
combined_image
.
paste(suit_shape
,
(0
,
int(image
.
height / 2)))
# Save the image as a PDF
pdf_output_path = '/mnt/data/formal_profile_picture
.
pdf'
combined_image
.
save(pdf_output_path
,
"PDF"
,
resolution=100
.
0)
pdf_output_path
INFO
Checkpoint & LoRA

Checkpoint
Juggernaut XL
#Cartoon
#Product Design
0 comment
0
0
0