attachment
attachment

Can you add a black border to it

Running Command

cd /tmp/workspace && mkdir -p border-task && python3 -c "from PIL import Image; im = Image.open('/tmp/workspace/attachments/cd14cba3-ec7a-47a4-8699-c96c93c41ac2/21914.png'); print(im.size, im.mode)"

Running Command

cd /tmp/workspace/border-task && python3 -c " from PIL import Image, ImageOps im = Image.open('/tmp/workspace/attachments/cd14cba3-ec7a-47a4-8699-c96c93c41ac2/21914.png').convert('RGB') border_size = 25 bordered = ImageOps.expand(im, border=border_size, fill='black') bordered.save('/tmp/workspace/border-task/21914_bordered.png') print(bordered.size) "

Done. I added a solid black border around the image.

21914 bordered

Image · PNG

Can you increase it a bit more by around 3mm

Running Command

cd /tmp/workspace/border-task && python3 -c " from PIL import Image, ImageOps im = Image.open('/tmp/workspace/attachments/cd14cba3-ec7a-47a4-8699-c96c93c41ac2/21914.png').convert('RGB') # Assuming 300 DPI (standard print resolution): 3mm -> ~35 px increase # Original border was 25px, new border = 25 + 35 = 60px border_size = 60 bordered = ImageOps.expand(im, border=border_size, fill='black') bordered.save('/tmp/workspace/border-task/21914_bordered_v2.png') print(bordered.size) "

I widened the border by about 3mm (assuming standard 300 DPI print resolution, that's roughly 35px added, making the total border 60px on each side).

21914 bordered v2

Image · PNG

Note: since I don't know the exact print size/DPI you're targeting, this is based on a 300 DPI assumption. Let me know if your image is meant for a different resolution and I can adjust precisely.

I want some more black border increase it by 5mm more

Running Command

cd /tmp/workspace/border-task && python3 -c " from PIL import Image, ImageOps im = Image.open('/tmp/workspace/attachments/cd14cba3-ec7a-47a4-8699-c96c93c41ac2/21914.png').convert('RGB') # 300 DPI assumption: 5mm -> ~59 px increase # Previous border was 60px, new border = 60 + 59 = 119px border_size = 119 bordered = ImageOps.expand(im, border=border_size, fill='black') bordered.save('/tmp/workspace/border-task/21914_bordered_v3.png') print(bordered.size) "

Added another 5mm of black border (about 59px at 300 DPI), bringing the total border to 119px on each side.

21914 bordered v3

Image · PNG

Increase it by 2mm more

Running Command

cd /tmp/workspace/border-task && python3 -c " from PIL import Image, ImageOps im = Image.open('/tmp/workspace/attachments/cd14cba3-ec7a-47a4-8699-c96c93c41ac2/21914.png').convert('RGB') # 300 DPI assumption: 2mm -> ~24 px increase # Previous border was 119px, new border = 119 + 24 = 143px border_size = 143 bordered = ImageOps.expand(im, border=border_size, fill='black') bordered.save('/tmp/workspace/border-task/21914_bordered_v4.png') print(bordered.size) "

Increased the border by another 2mm (about 24px at 300 DPI), bringing the total border to 143px on each side.

21914 bordered v4

Image · PNG

This is a shared conversation. Sign in to Orris to start your own chat.