What this prompt does
This prompt makes the AI a senior AI engineer who builds reliable vision extraction pipelines, designing Gemini vision prompts that turn chart screenshots into structured JSON precise enough to feed a database. You provide the [chart_types], the [image_quality], the [json_consumer], and the [accuracy_bar], and it returns the prompt set, the JSON schema, and the self-check loop as copy-ready text.
The six deliverables make the output trustworthy: one tailored extraction prompt per chart type (bar, line, pie, scatter); a locked output schema of {chart_type, title, x_axis, y_axis, series:[{name, points:[{x, y}]}]}; instructions for reading axes, legends, and units without hallucinating values; a self-check step where Gemini re-renders the extracted data and compares it to the input image; a confidence field plus a rule for flagging low-confidence points for human review; and handling for unreadable or partially occluded charts. The structure works because chart screenshots are where models guess numbers off pixels - the render-and-compare self-check and the confidence field are what keep the output honest.
When to use it
- You need to convert chart screenshots into structured, database-ready JSON.
- Your input images are mixed quality - screenshots and phone photos at varying resolution.
- You must avoid hallucinated values and want a built-in accuracy check.
- You feed the JSON to a downstream consumer like a Postgres ingestion job and need a locked schema.
- You want low-confidence points routed to human review rather than auto-accepted.
Example output
You get a set of extraction prompts - one per chart type in [chart_types] - that emit the locked schema {chart_type, title, x_axis, y_axis, series:[{name, points:[{x, y}]}]} with a confidence field, plus the self-check loop where Gemini re-renders the data and compares it to the source image, and rules for flagging low-confidence points and handling unreadable or occluded charts for your [json_consumer].
Pro tips
- Keep the self-check render-and-compare step; it is what makes the output trustworthy instead of a confident guess off pixels.
- Always keep the confidence field and route anything below your
[accuracy_bar]to a human - auto-accepting weak points pollutes the database. - Set
[image_quality]honestly; phone photos at mixed resolution need stricter occlusion handling than clean screenshots. - Use one tailored prompt per chart type in
[chart_types]; a single generic prompt reads a pie chart and a scatter plot very differently. - Match the locked schema to what your
[json_consumer]expects so ingestion does not need a reshaping step. - Treat unreadable or partially occluded charts as a defined case, not a silent failure, so bad inputs are flagged rather than fabricated.
- Spell out how to read axis units and legends in each prompt, since unit errors are subtle and a value off by a factor of a thousand still looks plausible.
- Set
[accuracy_bar]to match the cost of a wrong row downstream; a stricter threshold sends more to humans but keeps bad numbers out of the database.