AI chart image for a slide: AI backdrop, numbers drawn in code

For a chart on a slide, let the image model make the backdrop and style, and draw the bars, labels and values with a plotting library. Models invent data.

5 min readSume
All posts

For an AI chart image on a slide, use the model for the backdrop, color mood and decoration, and draw the bars, axes and values with a plotting library. An image model will produce a chart that looks right with numbers that are not yours, so anything that carries data must come from code.

Split the job

There are two layers. The art layer is the texture, gradient, illustration or photo behind the chart, and it benefits from a model. The data layer is the shapes and numbers, and it must be reproducible, so it belongs in code or a spreadsheet chart. Combining them at the end gives you both style and truth.

Generate the backdrop at slide ratio

Use 16:9 for slides. Ask for quiet areas where the chart will sit, so the bars keep contrast, and ask for no text or numbers.

curl -X POST https://api.sume.com/v1/images \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-image-2.5","prompt":"Soft abstract gradient backdrop in deep teal and warm sand, large calm area on the right, no text, no numbers, no charts","quality":"medium","aspect_ratio":"16:9"}'

Draw the chart with transparency

Plot with a library and save the chart with a transparent background, then place it over the backdrop. A simple matplotlib figure needs only a few lines.

import matplotlib.pyplot as plt

labels = ["Q1", "Q2", "Q3"]
values = [12, 18, 25]
fig, ax = plt.subplots(figsize=(8, 4.5))
ax.bar(labels, values, color="#0f766e")
ax.set_ylabel("Units (thousands)")
for spine in ("top", "right"):
    ax.spines[spine].set_visible(False)
fig.savefig("chart.png", transparent=True, dpi=200)

Check contrast and reading order

Put the chart over the quietest area and check that labels pass a contrast check at slide size. Keep the title as real slide text, so it can be edited, searched and read by assistive tools.

When the data is in the picture

If you start from an existing chart image and only need to change a label or translate it, use an edit with the image as the first reference. The label-translation pattern is in translate chart and diagram labels with Ideogram 4.5. Compare every value with the source afterwards.

Related posts

More in Use cases

All Use cases posts

Written by Sume