SACA ESTA IMAGEN EN PNG 4K, EN ESTA VISTA LATERAL

생성일: 2026년 1월 1일

답변에 사용된 모델 GPT-5.2 Thinking by Chat01

질문

capa cortass.PNGcapa cortass.PNG

SACA ESTA IMAGEN EN PNG 4K, EN ESTA VISTA LATERAL

Python

python
from PIL import Image, ImageFilter, ImageOps img_path = "/mnt/data/capa cortass.PNG" img = Image.open(img_path) img.mode, img.size ('RGBA', (304, 411))

Python

python
bg = img.getpixel((0,0)) bg (231, 231, 231, 255)

Python

python
from PIL import ImageEnhance, ImageChops target_w, target_h = 3840, 2160 # resize to fit height scale_h = target_h / img.size[1] new_w = int(round(img.size[0] * scale_h)) new_h = target_h resized = img.resize((new_w, new_h), resample=Image.LANCZOS) # optional mild sharpening try: from PIL import ImageFilter resized = resized.filter(ImageFilter.UnsharpMask(radius=2, percent=130, threshold=3)) except Exception as e: print("sharpen err", e) canvas = Image.new("RGBA", (target_w, target_h), bg) x = (target_w - new_w) // 2 y = 0 # align to top? original has margins; better center vertically too. but resized already full height, so y=0. canvas.paste(resized, (x, y), resized) out_path = "/mnt/data/imagen_lateral_4k.png" canvas.save(out_path, "PNG", optimize=True) out_path, canvas.size, new_w ('/mnt/data/imagen_lateral_4k.png', (3840, 2160), 1598)

Python

python
# create a quick downsample preview to check composition preview = canvas.resize((960, 540), Image.LANCZOS) preview_path = "/mnt/data/preview_4k.png" preview.save(preview_path) preview_path '/mnt/data/preview_4k.png'

Python

python
# create a quick downsample preview to check composition preview = canvas.resize((960, 540), Image.LANCZOS) preview_path = "/mnt/data/preview_4k.png" preview.save(preview_path) preview_path '/mnt/data/preview_4k.png' <<ImageDisplayed>>

Python

python
import os, pathlib, math os.path.getsize("/mnt/data/imagen_lateral_4k.png") 275476

Python

python
target_w2, target_h2 = 2160, 3840 scale_w = target_w2 / img.size[0] new_w2 = target_w2 new_h2 = int(round(img.size[1] * scale_w)) resized2 = img.resize((new_w2, new_h2), resample=Image.LANCZOS) resized2 = resized2.filter(ImageFilter.UnsharpMask(radius=2, percent=130, threshold=3)) canvas2 = Image.new("RGBA", (target_w2, target_h2), bg) x2 = 0 y2 = (target_h2 - new_h2)//2 canvas2.paste(resized2, (x2, y2), resized2) out_path2 = "/mnt/data/imagen_lateral_4k_vertical.png" canvas2.save(out_path2, "PNG", optimize=True) out_path2, canvas2.size, (new_w2,new_h2), y2 ('/mnt/data/imagen_lateral_4k_vertical.png', (2160, 3840), (2160, 2920), 460)

Python

python
preview2 = canvas2.resize((540, 960), Image.LANCZOS) preview2_path="/mnt/data/preview_4k_vertical.png" preview2.save(preview2_path) preview2_path '/mnt/data/preview_4k_vertical.png'

Python

python
preview2 = canvas2.resize((540, 960), Image.LANCZOS) preview2_path="/mnt/data/preview_4k_vertical.png" preview2.save(preview2_path) preview2_path '/mnt/data/preview_4k_vertical.png' <<ImageDisplayed>>

사고

preview2 = canvas2.resize((540, 960), Image.LANCZOS) preview2_path="/mnt/data/preview_4k_vertical.png" preview2.save(preview2_path) preview2_path

'/mnt/data/preview_4k_vertical.png'

<<ImageDisplayed>>

Thought for 1m 40s

답변

Listo — te la saqué en PNG 4K manteniendo esta vista lateral:

이 Q&A 공유하기