Revert L'Oreal profile to 3 checks and add hidden text detection

Reverted loreal_static from 2-check (visual_readability_contrast) to
3-check setup (language_consistency, text_readability, background_contrast)
to avoid score dilution. Updated text_readability and background_contrast
prompts from POS-focused to digital marketing, and added critical hidden/
invisible text detection (black-on-black, white-on-white scanning).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
nickviljoen 2026-03-30 12:28:57 +02:00
parent a1150268d6
commit a580d4bb0f
3 changed files with 138 additions and 55 deletions

View file

@ -1,18 +1,24 @@
{
"name": "L'Oreal Static",
"description": "L'Oréal focused quality control profile for digital static marketing materials. Evaluates visual readability, contrast, and language consistency.",
"description": "L'Oréal focused quality control profile for digital static marketing materials. Evaluates text readability, background contrast, and language consistency.",
"checks": {
"language_consistency": {
"enabled": true,
"weight": 5.0,
"weight": 3.33,
"llm": "Gemini",
"description": "Detects mixed languages in marketing text to ensure market-appropriate single-language content"
},
"visual_readability_contrast": {
"text_readability": {
"enabled": true,
"weight": 5.0,
"weight": 3.33,
"llm": "Gemini",
"description": "Combined check evaluating text readability (size, font clarity, spacing, overlapping) and background contrast (logo, product, text visibility) in a single assessment"
"description": "Evaluates text readability including size, font clarity, spacing, overlapping, and detection of hidden or invisible text"
},
"background_contrast": {
"enabled": true,
"weight": 3.34,
"llm": "Gemini",
"description": "Evaluates contrast and visibility of key design elements (logo, products, marketing text) against the background"
}
}
}

View file

@ -13,42 +13,79 @@ class BackgroundContrastApp(FlaskAppTemplate):
def __init__(self):
# Define the hardcoded prompt
prompt = """You are conducting a strict visual qualitycontrol check on a Point of Sale (POS) advertisement to verify that crucial design elements—including product images, the brand logo, and key text—stand out crisply from the background at a typical viewing distance of 3 meters.
prompt = """You are conducting a strict visual quality control check on a digital marketing asset to verify that all crucial design elements — including the brand logo, product images, and marketing text — are clearly visible and have sufficient contrast against the background.
EVALUATION STEPS:
1. Identify primary visuals:
a. Brand logo (extra scrutiny for brand consistency and brightness/vibrancy).
b. Product shots.
c. Main text or headlines.
CRITICAL: Evaluate the visibility and contrast of marketing/design elements. DO NOT evaluate text printed on product packaging, labels, or bottles that is part of the product itself.
2. Check clarity at a maximum viewing distance (3 meters):
a. Ensure the element remains legible or clearly visible without straining.
=== STEP 1: IDENTIFY KEY ELEMENTS ===
1. Identify all key visual elements:
a. Brand logo (extra scrutiny must be immediately recognizable)
b. Product shots or key imagery
c. Main marketing text, headlines, slogans, and CTAs
3. Evaluate color and brightness contrast:
a. Visually verify that each key element "pops" against the background.
b. Pay special attention to the brand logo. Any condition that makes the logo less than immediately recognizable at a glance is grounds for failing.
c. If any key element is difficult to distinguish, consider contrast insufficient.
=== STEP 2: EVALUATE CONTRAST AND VISIBILITY ===
2. For EACH element, assess contrast against its background:
a. Does the element clearly "pop" against the background?
b. Is the element immediately recognizable without straining?
c. Are the edges/boundaries of the element clearly distinguishable from the background?
4. Use a colorcontrast analyzer (e.g., APCA):
a. Confirm that larger elements meet or exceed ±Lc45.
b. Confirm that smaller text or detailed logos/icons meet or exceed ±Lc75.
c. Specifically check the brand logo area to ensure it meets or exceeds the recommended contrast level, highlighting any saturation/brightness issues.
3. Brand logo check (CRITICAL):
a. Is the brand logo present in the asset? A missing logo is a critical failure.
b. Is the logo immediately recognizable at a glance?
c. Does the logo have sufficient contrast with its background?
Decide pass/fail:
"Pass" only if ALL key elements (logo, product, text) remain sharp, legible, and clearly distinct from the background.
"Fail" if any single critical element has low contrast, appears fuzzy, or is overshadowed or faded relative to the background.
4. Product-background blending check (evaluate EACH product individually):
a. Examine EVERY product in the image separately
b. Dark-coloured products (black, dark grey) on dark backgrounds = FAIL
c. Light-coloured products (white, cream) on light backgrounds = FAIL
d. A product whose edges or silhouette are hard to distinguish from the background = FAIL
e. Even if most products have good contrast, a SINGLE product blending in = product check FAILS
Where possible, recommend one or two succinct improvement strategies (e.g., darkening the background, adding an outline/shadow, increasing the saturation of the logo colors).
5. Marketing text contrast check:
a. All marketing text must have clear contrast with its immediate background
b. Text placed over images must have proper contrast treatment (shadow, overlay, etc.)
c. Check for text that may be nearly invisible due to matching the background colour
YOUR OUTPUT:
State whether the design "passes" or "fails" the background contrast checkpoint.
If it fails, list one concise way to improve contrast.
Format your response as a JSON code block with the structure:
=== STEP 3: DETECT HIDDEN OR INVISIBLE ELEMENTS (CRITICAL) ===
6. Actively scan for elements that may be HIDDEN due to colour matching:
a. Are there dark elements (text, logo, graphic) on dark backgrounds that blend in?
b. Are there light elements on light backgrounds that blend in?
c. Are there areas where an element's colour is so close to the background that it becomes partially or fully invisible?
d. Look for faint outlines or subtle shadows that indicate something is present but hard to see
e. If ANY element is invisible or nearly invisible due to poor contrast, this is a CRITICAL FAIL (score 1-3)
=== SCORING GUIDANCE ===
- Score 9-10: All elements sharp, clear, excellent contrast throughout
- Score 7-8: Minor contrast issues (one element slightly less distinct, minor background competition)
- Score 5-6: Moderate issues (one product blending partially, text somewhat hard to read over background)
- Score 3-4: Significant issues (elements hard to distinguish, poor contrast on multiple items)
- Score 1-2: Critical failure (logo missing, elements invisible/hidden, major contrast failure across asset)
=== PASS/FAIL CRITERIA ===
- "Pass" only if ALL key elements (logo, every product, marketing text) are sharp, legible, and clearly distinct from the background
- "Fail" if ANY element has low contrast, blends into the background, is invisible/hidden, or is missing entirely
- "Fail" if any single product blends into the background, even if others are fine
YOUR OUTPUT MUST BE a JSON code block:
{
"background_contrast": "[Pass or Fail]",
"recommended_adjustments": "[None or Improvement]"
}"""
"background_contrast": "Pass" or "Fail",
"elements_checked": {
"logo": "Pass or Fail — brief explanation",
"product": "Pass or Fail — brief explanation for each product",
"marketing_text": "Pass or Fail — brief explanation"
},
"hidden_elements_check": "Pass" or "Fail" or "Suspected — [describe what appears hidden]",
"score": 1-10,
"explanation": "Detailed explanation of contrast assessment and any issues found",
"recommended_adjustments": ["Recommendation 1", "Recommendation 2"]
}
CRITICAL:
1. Always evaluate logo, products, AND marketing text separately
2. Actively LOOK FOR hidden/invisible elements do not just evaluate what is obviously visible
3. Scan dark areas for dark elements and light areas for light elements
4. A missing brand logo is always a critical failure
5. Never return just "Pass" or "Fail" without detailed explanation"""
# Initialize the Flask app with the prompt
super().__init__(__name__, prompt)

View file

@ -13,35 +13,75 @@ class TextReadabilityApp(FlaskAppTemplate):
def __init__(self):
# Define the hardcoded prompt
prompt = """You are performing a visual qualitycontrol check on a Point of Sale (POS) advertisement. Your task is to determine whether the text on the advertisement is readable from the appropriate viewing distance:
prompt = """You are performing a visual quality control check on a digital marketing asset. Your task is to evaluate whether ALL marketing text in the asset is clearly readable and whether any text may be missing or hidden.
For large media (FloorStanding Display Units, posters, etc.): The text must be clearly readable from about 3 meters away.
For smaller media (wobblers, shelf talkers, etc.): The text must be clearly readable from about 1 meter away.
CRITICAL: Evaluate only the MARKETING/ADVERTISING TEXT added to the creative (headlines, slogans, CTAs, promotional text, dates, legal lines). DO NOT evaluate text that is part of product packaging, labels, or bottles shown in the image product packaging text is not in scope.
STEPS TO EVALUATE:
1. Identify all text elements in the advertisement, excluding any terms and conditions.
2. Examine the text size, font style, and contrast with the background.
3. For each text element, assess whether it would be readable from the appropriate viewing distance.
4. Pay special attention to:
a. Text size - Is it large enough to be read from a distance?
b. Font choice - Is the font clear and easily readable?
c. Contrast - Does the text stand out clearly against its background?
d. Spacing - Is there sufficient spacing between letters, words, and lines?
5. Consider any potential obstacles to readability such as:
a. Decorative fonts that sacrifice legibility for style
b. Overlapping elements that obscure text
c. Poor contrast that makes text blend into the background
d. Text that is too small relative to viewing distance
=== STEP 1: IDENTIFY ALL MARKETING TEXT ===
1. Identify every marketing text element in the asset:
a. Headlines and main messages
b. Slogans and taglines
c. Calls to action (CTAs)
d. Promotional or descriptive body copy
e. Dates, offers, and legal/disclaimer lines
f. EXCLUDE: Text printed on product packaging, bottles, labels, or boxes
YOUR OUTPUT:
State whether the text elements "pass" or "fail" the readability checkpoint.
If they fail, provide 12 concise recommendations for improving text readability.
Include a JSON code block with these fields:
=== STEP 2: EVALUATE TEXT READABILITY ===
2. For each marketing text element, assess:
a. Text size Is it large enough to be comfortably read on digital screens?
b. Font choice Is the font clear and easily readable (not overly decorative)?
c. Contrast Does the text stand out clearly against its immediate background?
d. Spacing Is there sufficient spacing between letters, words, and lines?
e. Placement Is the text placed over a clean area or over a busy/complex background?
3. Check for overlapping and obstruction issues (CRITICAL):
a. Text overlapping with images, making it hard to read
b. Text overlapping with other text elements (e.g., two languages layered on top of each other)
c. Elements obscuring or partially covering marketing text
d. Text extending beyond visible boundaries or cropped by edges
e. Text placed over complex/busy backgrounds without proper contrast treatment (shadow, overlay, box, etc.)
=== STEP 3: DETECT HIDDEN OR INVISIBLE TEXT (CRITICAL) ===
4. Actively scan for text that may be INVISIBLE or HIDDEN due to colour matching:
a. Look carefully at DARK areas of the asset is there dark-coloured text (black, dark grey, dark brown) that blends into a dark background?
b. Look carefully at LIGHT areas of the asset is there light-coloured text (white, cream, pale) that blends into a light background?
c. Check if any text appears to be the SAME COLOUR as or very similar to the background behind it, making it partially or fully invisible
d. Look for faint outlines, subtle shadows, or barely-visible letterforms that indicate text is present but unreadable
e. Check edges and corners of the asset for text that may be cut off or lost against the background
5. Assess whether the marketing message feels COMPLETE:
a. Does the asset appear to be missing key text elements that would normally be expected (e.g., a headline exists but no supporting copy, or a product is shown with no descriptive text)?
b. Are there empty areas where text would logically be placed but nothing is visible?
c. If text appears to be missing or invisible, this is a CRITICAL FAIL score 1-2/10
=== SCORING GUIDANCE ===
- Score 9-10: All marketing text is clear, readable, well-spaced, good contrast
- Score 7-8: Minor issues (slightly small disclaimer text, minor spacing concern)
- Score 5-6: Moderate issues (some text hard to read, poor placement over busy area)
- Score 3-4: Significant issues (major text elements hard to read, poor contrast, overlapping text)
- Score 1-2: Critical failure (text invisible/hidden due to colour matching, major text completely unreadable, text missing entirely)
=== PASS/FAIL CRITERIA ===
- "Pass" if ALL marketing text elements are clear, readable, properly spaced, and no hidden/invisible text detected
- "Fail" if ANY marketing text is difficult to read, overlapping, obscured, poorly contrasted, hidden/invisible, or missing
YOUR OUTPUT MUST BE a JSON code block:
{
"text_readability": "Pass" or "Fail",
"readability_score": "High", "Medium", or "Low",
"recommendations": ["Recommendation 1", "Recommendation 2"] (only if "Fail")
}"""
"text_elements_found": ["List each marketing text element you identified"],
"hidden_text_check": "Pass" or "Fail" or "Suspected — [describe what appears hidden]",
"issues_found": ["List specific problems found"],
"score": 1-10,
"recommendations": ["Recommendation 1", "Recommendation 2"]
}
CRITICAL:
1. Always provide detailed analysis of what text was found and evaluated
2. Focus ONLY on marketing text, NOT product packaging text
3. Actively LOOK FOR hidden/invisible text do not just evaluate what is obviously visible
4. If text appears to be missing or invisible, this is a critical failure (score 1-2)
5. Never return just "Pass" or "Fail" without explanation"""
# Initialize the Flask app with the prompt
super().__init__(__name__, prompt)