# Restaurant Menu Image Service Adjustment Guide

## Goal

Improve your menu-generation service so it produces clean, branded and
visually attractive restaurant menu graphics.

Key requirements: - Logo must be fetched from URL or attachment - Logo
must be preserved and adapted correctly - Menu design must adapt to
cuisine type - Output should look like a real restaurant poster

------------------------------------------------------------------------

## Core Problems in Most AI Menu Generators

1.  Logo is treated like decoration instead of a brand anchor
2.  Menu text is passed as raw text instead of structured data
3.  Prompts are too generic
4.  No validation step after generation

------------------------------------------------------------------------

## Recommended Architecture

Instead of one prompt → image, use a pipeline.

1.  Parse menu
2.  Fetch and clean logo
3.  Detect brand colors
4.  Detect cuisine style
5.  Generate design brief
6.  Generate image
7.  Validate output

------------------------------------------------------------------------

## Step 1 --- Normalize Input

Example request object:

``` json
{
  "restaurantName": "Pizza Station Ancona",
  "logoUrl": "https://example.com/logo.png",
  "categories": [
    {
      "name": "Pizza",
      "items": [
        {"name": "Full", "price": "$29.99"},
        {"name": "Slice", "price": "$9.99"}
      ]
    }
  ]
}
```

Never pass a single blob of text.

------------------------------------------------------------------------

## Step 2 --- Logo Processing

When logo is provided:

1.  Download image
2.  Remove background if needed
3.  Normalize padding
4.  Preserve aspect ratio
5.  Extract dominant colors

Rules:

-   Logo must be placed at top
-   Never stretch logo
-   Never redraw logo

------------------------------------------------------------------------

## Step 3 --- Detect Cuisine Style

Examples:

Pizza / Fast Food: - bold typography - red / dark / warm palette

Mexican / Taco: - rustic tones - energetic layout

Fine Dining: - minimal layout - lots of whitespace

Cafe / Bakery: - soft palette - rounded layout blocks

------------------------------------------------------------------------

## Prompt Strategy

### System Prompt

    You generate premium restaurant menu posters.
    Always preserve brand identity.
    The logo must appear prominently at the top.
    Never distort or replace the logo.
    Design must match cuisine type.
    Typography must have strong hierarchy.
    Avoid clutter.

### Generation Prompt Template

    Create a premium restaurant menu poster.

    Restaurant: {{restaurant_name}}

    Brand rules:
    - use provided logo at top
    - respect logo colors

    Cuisine: {{cuisine_type}}

    Menu structure:
    {{formatted_menu_content}}

    Layout rules:
    - logo top area
    - clean category sections
    - readable prices
    - balanced spacing

------------------------------------------------------------------------

## Use Brand Colors

Extract palette from logo.

Example:

    brandColors:
    - #D71920
    - #123F86
    - #FFFFFF

Inject them into prompt so colors remain consistent.

------------------------------------------------------------------------

## Two‑Stage Generation (Recommended)

Stage 1 AI generates background and composition

Stage 2 Backend renders text and prices deterministically

Benefits: - correct spelling - perfect alignment - consistent typography

------------------------------------------------------------------------

## Quality Validation

Before returning menu:

Check: - logo present - categories complete - prices present - no
duplicate sections - text readable

If failed → regenerate or use template fallback.

------------------------------------------------------------------------

## Best Production Architecture

Hybrid rendering pipeline:

1 Parse menu 2 Fetch logo 3 Extract palette 4 Classify cuisine 5
Generate visual background 6 Render text using HTML/CSS/SVG 7 Overlay
logo 8 Export final image

------------------------------------------------------------------------

## Final Advice

Use AI for: - visual style - decorative layout - cuisine aesthetics

Use deterministic rendering for: - logo placement - text - prices -
spacing

That combination produces the best restaurant menus.
