Create a picture exactly like this. Professional, perfect.
A clean, professional medical diagram on white background showing MMC (Migrating Motor Complex) regulation. In the center is an oval/ellipse shape labeled "MMC" in large bold text. Four factors point toward the MMC oval with arrows: 1) Top-left: "Motilin" with a downward arrow and "+" symbol pointing into the oval from upper-left. 2) Top-right: "Serotonin (5-HT)" with a diagonal arrow and "+" symbol pointing into the oval from upper-right. 3) Bottom-left: "Substance 'p'" with a diagonal arrow pointing up-right into the oval. 4) Bottom-right: "Neurotensin" with an upward arrow pointing into the oval. On the left side of the oval, text reads "POSITIVE FEEDBACK MECHANISM" in capital letters. All text and arrows are in dark navy blue/indigo color on white background. Clean, professional scientific diagram style with clear typography.

Create a picture exactly like this. Professional, perfect.
mkdir -p /home/daytona/workspace/mmc-diagram && cat > /home/daytona/workspace/mmc-diagram/mmc.svg << 'EOF' <svg xmlns="http://www.w3.org/2000/svg" width="900" height="780" viewBox="0 0 900 780"> <!-- White background --> <rect width="900" height="780" fill="white"/> <!-- Color: dark navy/indigo blue like a ballpoint pen --> <!-- #1a1a6e or similar deep blue-purple --> <!-- ======= TOP LABELS ======= --> <!-- "Motilin" top-center-left --> <text x="280" y="90" font-family="Georgia, 'Times New Roman', serif" font-size="46" font-style="italic" fill="#1c1c8a" font-weight="normal" text-anchor="middle">Motilin</text> <!-- "Serotonin" top-right --> <text x="640" y="90" font-family="Georgia, 'Times New Roman', serif" font-size="46" font-style="italic" fill="#1c1c8a" font-weight="normal" text-anchor="middle">Serotonin</text> <!-- "(5-HT)" below Serotonin, slightly right --> <text x="680" y="148" font-family="Georgia, 'Times New Roman', serif" font-size="40" font-style="italic" fill="#1c1c8a" font-weight="normal" text-anchor="middle">(5-HT)</text> <!-- ======= LEFT LABEL: POSITIVE FEEDBACK MECHANISM ======= --> <text x="58" y="300" font-family="Arial, sans-serif" font-size="28" font-weight="bold" fill="#1c1c8a" font-style="normal" letter-spacing="1">POSITIVE</text> <text x="58" y="338" font-family="Arial, sans-serif" font-size="28" font-weight="bold" fill="#1c1c8a" font-style="normal" letter-spacing="1">FEEDBACK</text> <text x="58" y="376" font-family="Arial, sans-serif" font-size="28" font-weight="bold" fill="#1c1c8a" font-style="normal" letter-spacing="1">MECHANISM</text> <!-- ======= MMC OVAL (center) ======= --> <!-- Main oval --> <ellipse cx="460" cy="390" rx="175" ry="100" fill="none" stroke="#1c1c8a" stroke-width="3.5"/> <!-- MMC text inside oval --> <text x="460" y="408" font-family="Georgia, 'Times New Roman', serif" font-size="72" font-style="italic" fill="#1c1c8a" font-weight="normal" text-anchor="middle">MMC</text> <!-- Small circle/loop on left side of oval (positive feedback loop indicator) --> <ellipse cx="290" cy="390" rx="28" ry="38" fill="none" stroke="#1c1c8a" stroke-width="3"/> <!-- small curved tail below the loop --> <path d="M 278 420 Q 270 440 285 445" fill="none" stroke="#1c1c8a" stroke-width="2.5"/> <!-- ======= ARROW FROM MOTILIN (top, angled down-right into oval top-left) ======= --> <!-- Arrow line from ~(305,130) down to oval top-left ~(335,295) --> <line x1="310" y1="118" x2="338" y2="292" stroke="#1c1c8a" stroke-width="3"/> <!-- Arrowhead pointing down into oval --> <polygon points="338,292 328,272 348,272" fill="#1c1c8a"/> <!-- "+" sign next to arrow --> <text x="356" y="210" font-family="Georgia, serif" font-size="38" fill="#1c1c8a" font-style="italic">+</text> <!-- ======= ARROW FROM SEROTONIN (top-right, diagonal down-left into oval top-right) ======= --> <!-- Arrow line from ~(590,160) down-left to oval top-right ~(525,292) --> <line x1="588" y1="162" x2="528" y2="292" stroke="#1c1c8a" stroke-width="3"/> <!-- Arrowhead pointing down-left --> <polygon points="528,292 536,270 548,282" fill="#1c1c8a"/> <!-- "+" sign next to arrow --> <text x="548" y="232" font-family="Georgia, serif" font-size="38" fill="#1c1c8a" font-style="italic">+</text> <!-- ======= ARROW FROM SUBSTANCE P (bottom-left, diagonal up-right into oval bottom-left) ======= --> <!-- Label "Substance 'p'" bottom-left --> <text x="128" y="690" font-family="Georgia, 'Times New Roman', serif" font-size="44" font-style="italic" fill="#1c1c8a" font-weight="normal" text-anchor="middle">Substance 'p'</text> <!-- Arrow from ~(195,658) up-right to oval bottom ~(360,492) --> <line x1="210" y1="652" x2="358" y2="494" stroke="#1c1c8a" stroke-width="3"/> <!-- Arrowhead pointing up-right --> <polygon points="358,494 340,508 352,520" fill="#1c1c8a"/> <!-- ======= ARROW FROM NEUROTENSIN (bottom-right, straight up into oval bottom) ======= --> <!-- Label "Neurotensin" bottom-right --> <text x="648" y="690" font-family="Georgia, 'Times New Roman', serif" font-size="44" font-style="italic" fill="#1c1c8a" font-weight="normal" text-anchor="middle">Neurotensin</text> <!-- Arrow straight up from ~(590,655) to oval bottom-right ~(540,492) --> <line x1="590" y1="652" x2="542" y2="494" stroke="#1c1c8a" stroke-width="3"/> <!-- Arrowhead pointing up --> <polygon points="542,494 532,516 552,516" fill="#1c1c8a"/> </svg> EOF echo "SVG created"
cd /home/daytona/workspace/mmc-diagram && python3 - << 'PYEOF' import subprocess result = subprocess.run( ["inkscape", "--export-type=png", "--export-dpi=150", "--export-filename=mmc.png", "mmc.svg"], capture_output=True, text=True ) print("stdout:", result.stdout) print("stderr:", result.stderr) print("returncode:", result.returncode) import os if os.path.exists("mmc.png"): print("PNG size:", os.path.getsize("mmc.png"), "bytes") PYEOF
cd /home/daytona/workspace/mmc-diagram && python3 - << 'PYEOF' from PIL import Image, ImageDraw, ImageFont import math, os W, H = 1100, 900 img = Image.new("RGB", (W, H), "white") draw = ImageDraw.Draw(img) BLUE = (28, 28, 138) # deep navy blue, like ballpoint pen # ---- Try to load a font, fall back to default ---- def load_font(size, bold=False, italic=False): candidates_italic = [ "/usr/share/fonts/truetype/dejavu/DejaVuSerif-Italic.ttf", "/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf", "/usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf", ] candidates_bold = [ "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", "/usr/share/fonts/truetype/freefont/FreeSansBold.ttf", "/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", ] candidates_regular = [ "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf", "/usr/share/fonts/truetype/freefont/FreeSerif.ttf", ] pool = candidates_italic if italic else (candidates_bold if bold else candidates_regular) for p in pool: if os.path.exists(p): try: return ImageFont.truetype(p, size) except: pass return ImageFont.load_default() font_title = load_font(56, italic=True) # Motilin, Serotonin, etc. font_parens = load_font(46, italic=True) # (5-HT) font_label = load_font(30, bold=True) # POSITIVE FEEDBACK MECHANISM font_mmc = load_font(80, italic=True) # MMC inside oval font_plus = load_font(44, italic=True) # + signs # ---- Helper: draw arrow with arrowhead ---- def arrow(draw, x1, y1, x2, y2, color, width=3, head_size=18): draw.line([(x1,y1),(x2,y2)], fill=color, width=width) # Arrowhead at (x2,y2) angle = math.atan2(y2-y1, x2-x1) a1 = angle + math.pi*5/6 a2 = angle - math.pi*5/6 hx1 = x2 + head_size*math.cos(a1) hy1 = y2 + head_size*math.sin(a1) hx2 = x2 + head_size*math.cos(a2) hy2 = y2 + head_size*math.sin(a2) draw.polygon([(x2,y2),(hx1,hy1),(hx2,hy2)], fill=color) # ---- Oval (MMC center) ---- cx, cy = 490, 440 rx, ry = 185, 108 bbox = [cx-rx, cy-ry, cx+rx, cy+ry] draw.ellipse(bbox, outline=BLUE, width=4) # ---- MMC text inside oval ---- mmc_text = "MMC" bb = draw.textbbox((0,0), mmc_text, font=font_mmc) tw = bb[2]-bb[0]; th = bb[3]-bb[1] draw.text((cx - tw//2, cy - th//2 - 4), mmc_text, font=font_mmc, fill=BLUE) # ---- Small feedback loop circle on left edge of oval ---- lx, ly = cx - rx - 2, cy draw.ellipse([lx-26, ly-36, lx+22, ly+36], outline=BLUE, width=3) # small curved tail draw.arc([lx-10, ly+28, lx+20, ly+52], start=200, end=340, fill=BLUE, width=2) # ---- "Motilin" label (top, left-of-center) ---- draw.text((230, 65), "Motilin", font=font_title, fill=BLUE) # ---- Arrow from Motilin down into oval top-left ---- arrow(draw, 305, 135, 362, cx-ry+8, BLUE, width=3) # "+" next to arrow draw.text((316, 215), "+", font=font_plus, fill=BLUE) # ---- "Serotonin" label (top right) ---- draw.text((620, 65), "Serotonin", font=font_title, fill=BLUE) # "(5-HT)" below draw.text((670, 128), "(5-HT)", font=font_parens, fill=BLUE) # ---- Arrow from Serotonin diagonally down-left into oval top-right ---- arrow(draw, 670, 178, 570, cy-ry+8, BLUE, width=3) # "+" next to arrow draw.text((615, 260), "+", font=font_plus, fill=BLUE) # ---- POSITIVE FEEDBACK MECHANISM (left side) ---- draw.text((30, 310), "POSITIVE", font=font_label, fill=BLUE) draw.text((30, 350), "FEEDBACK", font=font_label, fill=BLUE) draw.text((30, 390), "MECHANISM", font=font_label, fill=BLUE) # ---- "Substance 'p'" label (bottom left) ---- draw.text((65, 760), "Substance 'p'", font=font_title, fill=BLUE) # ---- Arrow from Substance P up-right into oval bottom-left ---- arrow(draw, 230, 750, cx-rx+30, cy+ry-6, BLUE, width=3) # ---- "Neurotensin" label (bottom right) ---- draw.text((620, 760), "Neurotensin", font=font_title, fill=BLUE) # ---- Arrow from Neurotensin straight up into oval bottom-right ---- arrow(draw, 700, 748, cx+rx//2, cy+ry-6, BLUE, width=3) img.save("/home/daytona/workspace/mmc-diagram/mmc_diagram.png", dpi=(200,200)) print("Saved. Size:", os.path.getsize("/home/daytona/workspace/mmc-diagram/mmc_diagram.png")) PYEOF
python3 - << 'PYEOF' from PIL import Image, ImageDraw, ImageFont import math, os W, H = 1100, 950 img = Image.new("RGB", (W, H), "white") draw = ImageDraw.Draw(img) BLUE = (28, 28, 138) def load_font(size, bold=False, italic=False): candidates = { "italic": [ "/usr/share/fonts/truetype/dejavu/DejaVuSerif-Italic.ttf", "/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf", "/usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf", ], "bold": [ "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", "/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", ], "regular": [ "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf", "/usr/share/fonts/truetype/freefont/FreeSerif.ttf", ], } key = "italic" if italic else ("bold" if bold else "regular") for p in candidates[key]: if os.path.exists(p): try: return ImageFont.truetype(p, size) except: pass return ImageFont.load_default() font_title = load_font(58, italic=True) font_parens = load_font(48, italic=True) font_label = load_font(32, bold=True) font_mmc = load_font(82, italic=True) font_plus = load_font(52, italic=True) def arrow(draw, x1, y1, x2, y2, color=BLUE, width=3, head_size=20): draw.line([(x1,y1),(x2,y2)], fill=color, width=width) angle = math.atan2(y2-y1, x2-x1) a1 = angle + math.pi*5/6 a2 = angle - math.pi*5/6 hx1 = x2 + head_size*math.cos(a1) hy1 = y2 + head_size*math.sin(a1) hx2 = x2 + head_size*math.cos(a2) hy2 = y2 + head_size*math.sin(a2) draw.polygon([(x2,y2),(hx1,hy1),(hx2,hy2)], fill=color) def text_center(draw, text, cx, y, font, fill): bb = draw.textbbox((0,0), text, font=font) tw = bb[2]-bb[0] draw.text((cx - tw//2, y), text, font=font, fill=fill) # Oval center cx, cy = 510, 450 rx, ry = 195, 115 # === TOP LABELS === # "Motilin" -- center above-left of oval text_center(draw, "Motilin", 310, 55, font_title, BLUE) # "Serotonin" top right text_center(draw, "Serotonin", 740, 55, font_title, BLUE) # "(5-HT)" below and slightly right text_center(draw, "(5-HT)", 780, 122, font_parens, BLUE) # === ARROWS FROM TOP === # Motilin arrow: start below "Motilin" label, go slightly diagonally down to oval top motilin_start = (330, 128) motilin_end = (cx - rx//2, cy - ry + 5) # top-left of oval arrow(draw, *motilin_start, *motilin_end) # "+" to the right of arrow midpoint mx = (motilin_start[0]+motilin_end[0])//2 + 12 my = (motilin_start[1]+motilin_end[1])//2 - 10 draw.text((mx, my), "+", font=font_plus, fill=BLUE) # Serotonin arrow: diagonal down-left into oval top-right serotonin_start = (700, 175) serotonin_end = (cx + rx//3, cy - ry + 5) # top-right of oval arrow(draw, *serotonin_start, *serotonin_end) # "+" to the right of arrow midpoint sx = (serotonin_start[0]+serotonin_end[0])//2 + 12 sy = (serotonin_start[1]+serotonin_end[1])//2 - 10 draw.text((sx, sy), "+", font=font_plus, fill=BLUE) # === OVAL === bbox = [cx-rx, cy-ry, cx+rx, cy+ry] draw.ellipse(bbox, outline=BLUE, width=4) # === MMC text === mmc_text = "MMC" bb = draw.textbbox((0,0), mmc_text, font=font_mmc) tw = bb[2]-bb[0]; th = bb[3]-bb[1] draw.text((cx - tw//2, cy - th//2), mmc_text, font=font_mmc, fill=BLUE) # === Feedback loop circle on left of oval === lx, ly = cx - rx - 2, cy # Outer loop (elongated oval) draw.ellipse([lx-28, ly-42, lx+24, ly+42], outline=BLUE, width=3) # Small curved tail below (arc) draw.arc([lx-14, ly+28, lx+18, ly+54], start=210, end=340, fill=BLUE, width=2) # === POSITIVE FEEDBACK MECHANISM text (left) === draw.text((28, 325), "POSITIVE", font=font_label, fill=BLUE) draw.text((28, 368), "FEEDBACK", font=font_label, fill=BLUE) draw.text((28, 411), "MECHANISM", font=font_label, fill=BLUE) # === BOTTOM LABELS === # "Substance 'p'" bottom left text_center(draw, "Substance 'p'", 200, 820, font_title, BLUE) # Arrow from Substance P up-right into oval bottom-left sp_start = (230, 810) sp_end = (cx - rx//2 + 10, cy + ry - 5) arrow(draw, *sp_start, *sp_end) # "Neurotensin" bottom right text_center(draw, "Neurotensin", 760, 820, font_title, BLUE) # Arrow from Neurotensin up into oval bottom-right nt_start = (730, 810) nt_end = (cx + rx//3, cy + ry - 5) arrow(draw, *nt_start, *nt_end) out = "/home/daytona/workspace/mmc-diagram/mmc_final.png" img.save(out, dpi=(200,200)) print("Saved:", out, "size:", os.path.getsize(out)) PYEOF
mmc final
Image · PNG
I'll create a precise, professional SVG diagram that exactly replicates the layout of your hand-drawn diagram.