Kipt

Your prompts and skills, one keystroke away.

Explore

Codex images: attach screenshots, generate images and know the limits

Codex images explained: attach screenshots with --image or paste in the CLI, drag images into the IDE and app, generate images with $imagegen, plus usage limits.

By the Kipt team · Updated 26 October 2026

Codex can take images as input in the CLI, the IDE extension and the ChatGPT desktop app: paste one or pass --image in the terminal, or Shift-drag one into the composer in the editor and app. It can also generate images with the built-in $imagegen skill, which uses gpt-image-2 and draws from your normal Codex usage limits.

This guide covers attaching images on each surface, writing prompts around them, generating and editing images, what it costs in usage, and the limits OpenAI documents. Facts come from OpenAI's Image inputs and Image generation pages and the CLI reference, read on 26 October 2026.

What can you do with images in Codex?

There are two separate features, and OpenAI's docs keep them apart:

Feature What it is for How to start it
Image input Codex inspects a visual reference: an error screenshot, a UI design, an architecture diagram, an existing asset Attach or paste the image with your prompt
Image generation Codex creates or edits an image: UI assets, banners, backgrounds, illustrations, sprite sheets, placeholders Describe the image or include $imagegen

The image inputs page sums up the split: use an image input "when you want ChatGPT to inspect a visual reference," and image generation "when you want ChatGPT to create or edit an image."

How do you attach an image in the Codex CLI?

You have two options. Paste an image straight into the interactive composer, or pass files on the command line with -i or --image:

codex -i screenshot.png "Explain this error and suggest the smallest fix"
codex --image before.png,after.png "Compare these states and list the regressions"

For several images, separate the paths with commas or repeat the flag. The CLI reference describes --image, -i as attaching "one or more image files to the initial prompt."

The same flag works in scripts. codex exec accepts -i or --image to attach images to the first message, and codex exec resume accepts it for a follow-up prompt. One rule to remember: when you copy a session with codex exec fork, the reference says "A prompt is required when using images."

codex exec -i failing-test.png "Read the stack trace in this screenshot and fix the failing test"

Not every command takes images. The reference notes that codex queue, which queues a message for an existing session, doesn't support image attachments. See the Codex exec guide for the rest of the non-interactive flags.

How do you add images in the IDE extension and desktop app?

In both the IDE extension and the ChatGPT desktop app, drag the image into the prompt composer while holding Shift. In the editor, OpenAI explains, Shift makes the extension accept the drop instead of passing it to the editor.

The desktop app adds two more options, according to OpenAI's docs: you can ask Codex to inspect an image on your system, or use a screenshot tool to verify work in another app. Our Codex app guide covers the app itself.

How do you write a good prompt around an image?

An image alone rarely explains the task. OpenAI's advice is to name what the image shows, point to the area that matters, and state the output and constraints. If you attach more than one image, identify each one and explain how to compare them.

The docs give this example:

Compare this checkout screen with the design. Fix spacing and typography only;
do not change behavior. Verify the result with a new screenshot.

Some patterns that follow the same advice:

  • Bug reports: "The red banner in the top right is the error. Find where it is thrown and fix the cause, not the message."
  • Design match: "Image 1 is the current page, image 2 is the design. List every difference in spacing, color and font size, then fix them."
  • Diagrams: "This is our intended service layout. Check the code in services/ against it and list where they differ."

Can Codex generate images?

Yes, in the CLI, the IDE extension and the desktop app. Describe the image in natural language, or include $imagegen in your prompt to invoke the image generation skill explicitly. To guide the result with an existing asset, attach it with -i or --image in the CLI, or Shift-drag it into the composer in the extension.

$imagegen Create a 1200x630 social preview image for this repo's README:
a simple terminal window on a dark background, no text, no logos.

In the desktop app, selecting a generated image opens an expanded viewer with Focused view and Canvas view. In Canvas view you can Comment on one or more images, use Multi-select to pick them, and send the comments with editing instructions in the same chat.

OpenAI's tips for image prompts are short and practical: one to three clear sentences, the purpose and audience, the main subject, setting and style, framing and dimensions when they matter, and constraints such as what must not appear. When editing, "say exactly what should change and what must stay the same." For text inside an image, put the exact words in quotation marks and keep them short.

How does image generation count toward Codex usage limits?

The image generation page states that built-in image generation "uses gpt-image-2 and counts toward your general Codex usage limits." It also says image generations use included limits 3 to 5 times faster on average than similar turns without image generation, depending on image quality and size.

The Codex pricing page adds, as of October 2026:

  • Image generation counts toward the same general usage limits as local messages and cloud chats.
  • After you reach your included limits, image generation also draws from credits.
  • Image generation isn't available on the Free plan.
  • When you use Codex with an API key, API pricing applies instead of included ChatGPT usage limits.

For larger batches, OpenAI suggests setting OPENAI_API_KEY in your environment and asking Codex to generate images through the API, so API pricing applies. Check your remaining limits with /status in the CLI or on the usage dashboard. Our Codex pricing guide explains plans and credits.

What are the limits of images in Codex?

What OpenAI documents, and what it does not:

Topic What the docs say
Formats "Common image formats, including PNG and JPEG." No full list is published.
Number of images Several per prompt, comma-separated or with repeated --image. No maximum is published.
File size or resolution Not documented on the image inputs page.
Free plan Image generation isn't available on Free; the image inputs page sets no plan rule for input.
codex exec fork Images require a prompt.
codex queue Image attachments aren't supported.
Generation model gpt-image-2

There is also a local tool behind the scenes. The configuration reference lists tools.view_image, which enables "the local-image attachment tool view_image."

On the content side, OpenAI's image generation page asks you to use likenesses of real people with care and with permission, to request original treatments instead of imitating a specific brand or artist, and to follow OpenAI's usage policies.

Save the image prompts that work

Image prompts take a few rounds to get right, and the good ones are worth keeping. Kipt stores prompts as Markdown in a private GitHub repo you own, with {{name}} blanks for the parts that change, such as the screen name or the image size. If your task also needs current information, the Codex web search guide covers live and cached search.

Questions

Can Codex read images?

Yes. You can give Codex screenshots, diagrams and design references as context. In the CLI, paste an image into the composer or pass files with -i or --image. In the IDE extension and the ChatGPT desktop app, drag an image into the prompt composer while holding Shift.

How do I attach multiple images in the Codex CLI?

Separate the paths with commas, as in codex --image before.png,after.png "Compare these states", or repeat the --image flag. Then tell Codex which image is which and how to compare them, because the docs advise naming what each image shows.

What image formats does Codex accept?

OpenAI's image inputs page says Codex accepts common image formats, including PNG and JPEG. It doesn't publish a full list of formats or a maximum file size, so convert unusual formats to PNG or JPEG if an attachment fails.

Can Codex generate images?

Yes. In the CLI, IDE extension and desktop app you can describe an image, or include $imagegen in your prompt to invoke the image generation skill explicitly. Built-in image generation uses gpt-image-2 and counts toward your general Codex usage limits.

Does image generation use more of my Codex limits?

Yes. OpenAI says image generations use included limits 3 to 5 times faster on average than similar turns without image generation, depending on image quality and size. Image generation isn't available on the Free plan, and with an API key, API pricing applies instead.

Can I attach images in codex exec?

Yes. codex exec accepts -i or --image to attach images to the first message, and the flag is repeatable or takes a comma-separated list. codex exec resume accepts it for a follow-up prompt, and codex exec fork requires a prompt when you attach images.

More in Codex

All guides

Keep your prompts and skills in one place, in your own GitHub. Install every skill with one command.

Get started

Kipt is an independent product, not affiliated with or endorsed by Anthropic, OpenAI, Cursor or GitHub. Claude, ChatGPT, Codex, Cursor and GitHub are trademarks of their owners.