
    i                        d Z ddlmZ ddlZddlmZ ddlmZ  ed      Zedz  Z	edz  Z
 ed	      Z ej                         d
z  ZddZddZedk(  r e        yy)u   컨셉 #41 당신 같은 사람 (Unedited Reality Portrait) 하이브리드 이미지 생성.

Gemini 생성 인물 이미지를 폴라로이드 프레임에 배치하고
HTML/CSS 텍스트 오버레이를 Playwright로 합성합니다.
    )annotationsN)Path)sync_playwrightzN/home/jay/workspace/output/meta-ads/concept-catalog/41-cannes-unedited-realityzperson-background.jpgz
sample.pngzR/home/jay/workspace/output/meta-ads/concept-catalog/41-cannes-unedited-reality.pngz.local/share/fonts/Pretendardc                b    dt          dt          dt          dt          dt          dt          d|  dS )	u?   폴라로이드 프레임 + 텍스트 오버레이 HTML 생성.z<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-Black.otf') format('opentype');
    font-weight: 900;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-ExtraBold.otf') format('opentype');
    font-weight: 800;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-Bold.otf') format('opentype');
    font-weight: 700;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-SemiBold.otf') format('opentype');
    font-weight: 600;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-Medium.otf') format('opentype');
    font-weight: 500;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://uA  /Pretendard-Regular.otf') format('opentype');
    font-weight: 400;
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body {
    width: 1080px;
    height: 1080px;
    overflow: hidden;
    background: #F5F0E8;
  }

  .canvas {
    width: 1080px;
    height: 1080px;
    position: relative;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background: #F5F0E8;
  }

  /* 상단 로고 영역 */
  .brand-top {
    position: absolute;
    top: 48px;
    left: 72px;
    font-size: 40px;
    font-weight: 600;
    color: #1C1C1C;
    letter-spacing: -0.5px;
  }

  .brand-right {
    position: absolute;
    top: 48px;
    right: 72px;
    font-size: 40px;
    font-weight: 400;
    color: #8A8A8A;
  }

  /* 폴라로이드 프레임 */
  .polaroid-frame {
    position: absolute;
    top: 116px;
    left: 130px;
    width: 820px;
    height: 560px;
    background: #FFFFFF;
    padding: 18px;
    padding-bottom: 64px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.20), 0 2px 8px rgba(0,0,0,0.12);
    border-radius: 4px;
    transform: rotate(-0.4deg);
  }

  /* 이미지 영역 */
  .photo-area {
    width: 100%;
    height: 440px;
    background: #D4CFC5;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
  }

  .photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }

  /* 폴라로이드 캡션 */
  .polaroid-caption {
    margin-top: 12px;
    text-align: center;
    font-size: 42px;
    font-weight: 500;
    color: #5A5A5A;
    line-height: 1.3;
    white-space: nowrap;
  }

  .polaroid-caption .highlight {
    color: #C8102E;
    font-weight: 700;
  }

  /* 핵심 메시지 */
  .main-headline {
    position: absolute;
    top: 716px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 90px;
    font-weight: 800;
    color: #1C1C1C;
    letter-spacing: -2px;
    line-height: 1.05;
  }

  /* 보조 메시지 */
  .sub-message {
    position: absolute;
    top: 844px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 46px;
    font-weight: 600;
    color: #5A5A5A;
    letter-spacing: -0.5px;
  }

  /* CTA 버튼 */
  .cta-wrapper {
    position: absolute;
    top: 942px;
    left: 0;
    right: 0;
    text-align: center;
  }

  .cta-btn {
    display: inline-block;
    font-size: 44px;
    font-weight: 700;
    color: #FFFFFF;
    background: #1C1C1C;
    padding: 14px 48px;
    border-radius: 4px;
    letter-spacing: -0.5px;
  }

  /* 폴라로이드 세부 텍스처 (약간의 노이즈감) */
  .polaroid-frame::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    border-radius: 4px;
    opacity: 0.3;
  }
</style>
</head>
<body>
<div class="canvas">

  <!-- 브랜드 상단 -->
  <div class="brand-top">T.O.P 사업단</div>
  <div class="brand-right">인카금융서비스</div>

  <!-- 폴라로이드 프레임 -->
  <div class="polaroid-frame">
    <div class="photo-area">
      <img src="file://u  " alt="FA 인물 사진" />
    </div>
    <div class="polaroid-caption">
      이분이 지난달 <span class="highlight">1,200만</span>원 번 FA입니다
    </div>
  </div>

  <!-- 핵심 메시지 -->
  <div class="main-headline">당신도 될 수 있습니다.</div>

  <!-- 보조 메시지 -->
  <div class="sub-message">정착지원금으로 안정적 시작</div>

  <!-- CTA -->
  <div class="cta-wrapper">
    <span class="cta-btn">지금 상담 신청하기 →</span>
  </div>

</div>
</body>
</html>)FONT_DIR)bg_image_paths    `/home/jay/workspace/.worktrees/task-2116-dev1/tools/ai-image-gen/_backup/gen_concept41_hybrid.py
build_htmlr
      sj     Z  
 Z  
 Z  
 Z  
 Z  
 Z b D & 'EV V    c                    t         j                         st        dt                t        j	                  dd       t        t        t         j                                     } t        dz  }|j                  | d       t        d|        t        d       t               5 }|j                  j                         }	 |j                  d	d	d
      }|j                  d|j                          d       |j                  d       |j!                  t        t"              d       |j%                          	 d d d        t"        j'                         j(                  }t        dt"         d|dd       t+        j,                  t"        t.               t        dt.                y # |j%                          w xY w# 1 sw Y   xY w)Nu   배경 이미지 없음: T)parentsexist_okz_concept41_template.htmlzutf-8)encodingu   HTML 템플릿 저장: u   Playwright로 합성 중...i8  )widthheight)viewportzfile://networkidle)
wait_untili  png)pathtypeu   sample.png 저장 완료: z (,z bytes)u   카탈로그 복사본 저장: )BG_IMAGEexistsFileNotFoundError
OUTPUT_DIRmkdirr
   strresolve
write_textprintr   chromiumlaunchnew_pagegotowait_for_timeout
screenshotSAMPLE_OUTPUTclosestatst_sizeshutilcopy2CATALOG_OUTPUT)html_content	html_pathpbrowserpagesizes         r	   mainr5      sx   ??";H: FGGTD1c("2"2"456L77I8	#I;
/0	
'(		 	a**##%	##tt-L#MDII	 1 1 345-IP!!$'OO]!3%O@MMO	 ''D	&}oRQxw
GH LL/	+N+;
<= MMO	 	s%   #F=?A*F()F=(F::F==G__main__)r   r   returnr   )r7   None)__doc__
__future__r   r,   pathlibr   playwright.sync_apir   r   r   r(   r.   homer   r
   r5   __name__ r   r	   <module>r@      sx    #   /
 bc
//\)jk499;88
Xv>> zF r   