DEV Community

El Bruno
El Bruno

Posted on • Originally published at elbruno.com on

🧠✨ Testing GPT-4o’s Image Generation – From C# with ❤️ and Microsoft.Extensions.AI

Hi!

OpenAI just dropped some exciting news:

👉 GPT-4o can now generate images directly from prompts.

Announced here: Introducing GPT-4o Image Generation, this new feature lets you go from words to stunning visuals – including photorealistic scenes, illustrations, logos, and more.

The fun part? You can now generate images just by chatting with GPT-4o.

The challenging part? If you’re a developer trying this via the OpenAI API… it’s not quite ready yet 😅


🎯 My Test: “Make Me a Cute Sticker”

So, naturally, I tried this in ChatGPT — and it worked beautifully.

Just uploaded a photo of my cat, added this prompt:

“Make me a cute minimalist sticker based on the provided image. Use a thick white border and transparent background.”

Boom 🐾 — instant sticker! Minimalist lines, clear cat expression, perfect for printing or slapping on your laptop.


🔧 Now Let’s Try in C# (Spoiler: it’s not ready… yet)

Being a .NET fanboy and AI tinkerer, I fired up a quick console app using the awesome new Microsoft.Extensions.AI library — designed to unify and simplify AI model calls from .NET.

Here’s my code using the OpenAIClient with GPT-4o:


📉 The Actual Output

Here’s what I got back from GPT-4o via API:


Prompt: make me a cute minimalist sticker based on the provided image...

Response:
To create a cute minimalist sticker from the provided image, follow these steps:
1. Crop and Simplify...
2. Add a thick white border...
3. Use a transparent background...

You can use tools like Adobe Illustrator or Canva.

Enter fullscreen mode Exit fullscreen mode

Basically — the model understood the task, but instead of returning a new image, it gave instructions 📄.


❗ Why the Disconnect?

The image generation capability is live in ChatGPT, but not yet exposed via the OpenAI API.

As of now:

  • GetResponseAsync() from Microsoft.Extensions.AI supports image inputs ✅
  • But image generation as an output is not yet supported ❌

So developers: sit tight, it’s coming.


💡 Takeaways

  • GPT-4o’s new image generation is 🔥 — in ChatGPT.
  • If you’re building with .NET and Microsoft.Extensions.AI, you’re already in a great spot to tap into these APIs as soon as image outputs are supported.
  • Until then, your code can analyze and interpret images with GPT-4o, but it can’t yet generate them.

👀 What’s Next?

I’m keeping this code snippet ready for when OpenAI opens up the feature.

And I’m already thinking about using this in:

  • Sticker generators 🐱
  • Avatar creators 🧙
  • Meme bots 🤖
  • Or even something weird, like “What if your plant could draw?”

Let me know if you want to explore this together — or if you’re building cool stuff with GPT-4o and .NET.

Until then, happy coding!

— Bruno 💬 🐾

Top comments (0)