Generate 3 logo concepts on a solid background, test them small
A prompt for three small-shop logo concepts on a solid background in two colors, plus a script that measures the background, color count and 32px legibility.
When an AI hands back logo concepts for a small shop, the first things to filter on are not whether you like the shape. Is there one background, how many colors are in it, and does the shape survive at favicon size (32×32)? The example is an invented neighborhood bakery, "Millfield". The post builds a prompt for three concepts and a script that checks the files you get back.
[1] Google Cloud's Imagen prompt guide suggests the template A {logo_style} logo for a {company_area} company on a solid color background for logos, and says a solid background keeps results consistent. Read that as: with the background fixed, concepts differ only in shape. The prompts below add a color count and a list of things to leave out. They ask for three symbol-only concepts (lines starting with # are notes).
# Concept 1 - wheat stalkA minimalist flat logo mark for a neighborhood bakery, a single wheat stalk, two colors (navy #1B2A4A and amber #D49B42), on a solid flat cream #F5F0EB background, bold shapes, centered with wide margins, no text, no gradients, no shadows.# Concept 2 - bread loafA minimalist flat logo mark for a neighborhood bakery, a round bread loaf with one scored line, two colors (navy #1B2A4A and amber #D49B42), on a solid flat cream #F5F0EB background, bold shapes, centered with wide margins, no text, no gradients, no shadows.# Concept 3 - letter MA minimalist flat logo mark for a neighborhood bakery, the letter M built from two curved grain spikes, two colors (navy #1B2A4A and amber #D49B42), on a solid flat cream #F5F0EB background, bold shapes, centered with wide margins, no gradients, no shadows.The slots to change are the motif (a single wheat stalk), the business, the two colors and the HEX value of the background. no text keeps lettering out of the concept stage; concept 3 omits it because the letter is the symbol.
[2] A logo that contains text is requested separately. The Gemini image generation guide says to state the wording, the character of the typeface and the color scheme when text goes into an image.
A minimalist flat logo for a neighborhood bakery: the wheat stalk mark above the text "MILLFIELD" in bold uppercase sans-serif letters, two colors (navy #1B2A4A and amber #D49B42), on a solid flat cream #F5F0EB background, centered, the text spelled exactly M-I-L-L-F-I-E-L-D with no other words, no gradients, no shadows.[3] When the concepts arrive, run the files through a checker. run/logo_check_en.py uses only Pillow. It shrinks the image to 512px on the long side and looks at four things: whether the edge ring and the four corners share one color, whether the share of pixels that differ from the background is 3-60%, whether there are at most 2 foreground colors, and whether at least 80% of the connected blobs are still there at 64px and 32px. Setup lines are cut with ….
…ring = [px[x, y] for x in range(W) for y in range(H) if x < 4 or y < 4 or x >= W - 4 or y >= H - 4]bg = med(ring)flat = sum(dist(c, bg) <= 12 for c in ring) / len(ring)corners = [med([px[x, y] for x in range(a, a + 8) for y in range(b, b + 8)]) for a in (0, W - 8) for b in (0, H - 8)]spread = max(dist(a, b) for a in corners for b in corners)ok = flat >= 0.97 and spread <= 8print(f"background {hexc(bg)} · edge uniformity {flat:.0%} · corner spread {spread} → {'OK' if ok else 'FAIL'}")if not ok: fails.append("background") def mask_of(img): p = img.load(); w, h = img.size return [[dist(p[x, y], bg) > 48 for x in range(w)] for y in range(h)] m = mask_of(im)cover = sum(map(sum, m)) / (W * H)ok = 0.03 <= cover <= 0.60print(f"foreground share {cover:.1%} (must be 3-60%) → {'OK' if ok else 'FAIL'}")if not ok: fails.append("foreground share")…centers = pieces(m)line = f"of {len(centers)} pieces,"for size in (64, 32): small = im.resize((size, size), Image.LANCZOS); ms = mask_of(small); k = W // size kept = sum(ms[cy // k][cx // k] for cx, cy in centers) ok = len(centers) > 0 and kept / len(centers) >= 0.8 line += f" {kept} left at {size}px {'OK' if ok else 'FAIL'}," if not ok: fails.append(f"{size}px")print(line.rstrip(","))print("verdict: " + ("pass" if not fails else "fail (" + ", ".join(fails) + ")"))sys.exit(1 if fails else 0)No AI-made file existed yet, so it was first run on seven test images of the same kind (drawn with run/make_fixtures.py; they are not AI output). A good concept:
$ python run/logo_check_en.py run/concept_ok.pngbackground #F5F0EB · edge uniformity 100% · corner spread 0 → OKforeground share 6.9% (must be 3-60%) → OKforeground colors 2 (#D09040, #102040) · expected at most 2 → OKof 7 pieces, 7 left at 64px OK, 7 left at 32px OKverdict: passAll seven. The PNG and the JPEG (1024px, quality 60) should pass; the other five carry a deliberate flaw.
$ python run/fixtures_report.py enconcept_colors.png: verdict: fail (color count)concept_gradient.png: verdict: fail (background)concept_ok.png: verdict: passconcept_ok_jpeg.jpg: verdict: passconcept_shadow.png: verdict: fail (color count)concept_small_text.png: verdict: fail (32px)concept_thin.png: verdict: fail (foreground share, 64px, 32px)Foreground colors are printed as the representative value of a 16-step bucket, so #D09040 stands for #D49B42. All five flawed images failed, but the first version of the script passed one of them. It decided that a blob had survived if anything was foreground in the 3×3 pixels around its center, and a large shape next to the small text hid the missing letters, so concept_small_text.png passed. Looking at the one pixel at the center fixed that: only 14 of 22 pieces were left at 32px.
[4] What the script cannot see is a person's job.
| Look at | How |
|---|---|
| Spelling of text | Enlarge the combination concept and tick M-I-L-L-F-I-E-L-D one letter at a time |
| Hangul shop names | Not tested in this run. An English spelling is easier to compare, so try that first |
| A stray color under 3% of the foreground | Even if the color count passes, look at the 32px version once |
| Taste | Put the three concepts side by side at 32px and choose |
If the files you get are raster images (PNG, JPEG), anything printed large, such as a sign or a stamp, has to be redrawn as a vector. This post stops at narrowing to three concepts; for shrinking and checking a vector file see Shrink and check an AI-made SVG with svgo.