Skip to main content
Internal Service β€” This is not an HTTP endpoint. It’s called by the enhanced logo service.

Purpose

Uses OpenAI’s gpt-image-1.5 to transform a favicon into a hand-sketched artistic version.

Function Signature

async def generate_enhanced_logo(png_bytes: bytes) -> dict

Parameters

ParameterTypeDescription
png_bytesbytesFavicon as PNG bytes

Returns

{
    "success": True,
    "image_base64": "iVBORw0KGgo...",
    "image_data_url": "data:image/png;base64,iVBORw0KGgo..."
}

Style Transfer Approach

The function sends two images to OpenAI:
  1. base_image.png - A hand-sketched Target logo (style reference)
  2. target_image.png - The favicon to transform
The prompt instructs the model to apply the sketched style from image 1 to image 2.

Prompt Engineering

CRITICAL: You are receiving TWO images in a specific order:
- FIRST IMAGE (base_image.png): The Target retail company logo drawn in 
  hand-sketched style - this is ONLY for style reference
- SECOND IMAGE (target_image.png): A different company's favicon/logo - 
  this is what you MUST transform

YOUR TASK: Redraw the SECOND IMAGE using the hand-sketched artistic style 
from the FIRST IMAGE.

Code Location

src/website/enhanced_logo/service.py
# Lines 170-233: generate_enhanced_logo()