# The performance difference between ChatGPT4o and gpt4o api using the same prompt for image analysis

**URL:** <https://community.openai.com/t/the-performance-difference-between-chatgpt4o-and-gpt4o-api-using-the-same-prompt-for-image-analysis/821401>\
**Category:** API\
**Tags:** gpt-4, chatgpt, gpt-4-vision, gpt4-vision, api-vision\
**Created:** [June 15, 2024, 3:11pm UTC](https://community.openai.com/t/the-performance-difference-between-chatgpt4o-and-gpt4o-api-using-the-same-prompt-for-image-analysis/821401 "2024-06-15T15:11:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HuixinZhong](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@HuixinZhong](https://community.openai.com/u/HuixinZhong)\
**Post date:** [June 15, 2024, 3:11pm UTC](https://community.openai.com/t/the-performance-difference-between-chatgpt4o-and-gpt4o-api-using-the-same-prompt-for-image-analysis/821401/1 "2024-06-15T15:11:07Z")

</div>

When I use the same prompt shown as follows to analyze images using chatgpt4o and gpt4o api. Why I get very different results: very good result from chatgot4o while totally wrong answers from gpt4o api? wondering why

 ![1](https://us1.discourse-cdn.com/openai1/original/4X/7/8/d/78dc1938fe8a7fd7f63dd641c2e6344bf768c4fe.png)

You are an AI image processing expert. Your task is to accurately determine which line segment {A, B, C} has the same length as {S} in each image. Follow the detailed steps below to ensure accurate measurement and comparison:

```
        Load Image: Read each image from the current folder. Each image is named from '1.PNG' to '18.PNG'.
        Format conversion: Convert .PNG images into numpy array for further analysis.
        Access Pixels: Use the pixel values to measure the lengths of the vertical line segments.
        Measure Line Lengths:
        For each column in the image, count the number of consecutive white pixels (pixel value 255) to determine the length of each vertical line.
        Each image contains four white vertical line segments representing {S, A, B, C}, arranged from left to right respectively.
        The width of each line segment is one pixel.
        Compare Lengths: Measure the pixel length of each separated line segment for {S, A, B, C} and compare which line segment from {A, B, C} has the same length as {S}.
        Provide Answer: Based on the measurements, provide a single answer (A, B, or C) for each image.
        Your answer needs to be based on precise pixel length measurements. Ensure that the following process is used:
        
        Determine which line segment (A, B, or C) has the same length as S and provide the answer.
        Final Answer Format:
        For each image, provide the answer in the format: Image [number]: [A/B/C]

```

---

<div class="post-metadata">

**Author:** ![PaulBellow](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paulbellow/32/597962_2.png) [@PaulBellow](https://community.openai.com/u/PaulBellow)\
**Post date:** [June 15, 2024, 6:32pm UTC](https://community.openai.com/t/the-performance-difference-between-chatgpt4o-and-gpt4o-api-using-the-same-prompt-for-image-analysis/821401/2 "2024-06-15T18:32:21Z")

</div>

Tagging, @Foxalabs …

It’s been noted that 4o is not as “good” as GPT-4-Vision, but the teams are working on it, I’m sure.

We’re working on getting more clarification…

---

<div class="post-metadata">

**Author:** ![Foxalabs](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/foxalabs/32/738355_2.png) [@Foxalabs](https://community.openai.com/u/Foxalabs)\
**Post date:** [June 15, 2024, 6:35pm UTC](https://community.openai.com/t/the-performance-difference-between-chatgpt4o-and-gpt4o-api-using-the-same-prompt-for-image-analysis/821401/3 "2024-06-15T18:35:24Z")

</div>

Hi,

Physical relationships are not one of it’s strong suits currently, try the `GPT-4-VISION-PREVIEW ` model, exactly the same API call, just change the model name. See how that performs.

---

<div class="post-metadata">

**Author:** ![anon22939549](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@anon22939549](https://community.openai.com/u/anon22939549)\
**Post date:** [June 15, 2024, 6:55pm UTC](https://community.openai.com/t/the-performance-difference-between-chatgpt4o-and-gpt4o-api-using-the-same-prompt-for-image-analysis/821401/4 "2024-06-15T18:55:40Z")

</div>

I have two things I’ll add which might help,

1. If this is indicative if the _actual_ problem you need to solve, then there are better tools for this job. Writing a Portion script which identifies adjacent pixels of the same color and determining the number of pixels in that line segment is fairly trivial.
2. If this is a type of minimally working example of a problem you are trying to solve, adding an overlay of horizontal lines to the image will help tremendously in your efforts to “ground” the visual model in reality. (This will also help if this is your actual problem.)

I hope that helps!

Didn’t fight the models, learn their limitations and meet them where they are!

---

<div class="post-metadata">

**Author:** ![HuixinZhong](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@HuixinZhong](https://community.openai.com/u/HuixinZhong)\
**Post date:** [June 17, 2024, 6:35am UTC](https://community.openai.com/t/the-performance-difference-between-chatgpt4o-and-gpt4o-api-using-the-same-prompt-for-image-analysis/821401/5 "2024-06-17T06:35:47Z")

</div>

thank you for your advice. gpt4 vision preview does not work well either.

---

<div class="post-metadata">

**Author:** ![frippe75](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/frippe75/32/148344_2.png) [@frippe75](https://community.openai.com/u/frippe75)\
**Post date:** [July 27, 2024, 6:50am UTC](https://community.openai.com/t/the-performance-difference-between-chatgpt4o-and-gpt4o-api-using-the-same-prompt-for-image-analysis/821401/6 "2024-07-27T06:50:02Z")

</div>

Sorry for possibly hijacking the thread.

But I think I’m seeing the same thing.  
via ChatGPT interface and using the gpt-4o model it correctly answer a question about an image. It’s like a yes/no type of question. Answer yes 10/10 times.

Using the following:

```auto
payload = {
        "model": model,
        "messages": [
            {
                "role": "user",
                "content": [
                    {
                        "type": "text",
                        "text": prompt
                    },
                    {
                        "type": "image_url",
                        "image_url": {
                            "url": f"data:image/jpeg;base64,{base64_image}"
                        }
                    }
                ]
            }
        ],
        "max_tokens": 500
    }

```

Tried increasing the tokens but looking in playground it’s about 233 tokens consumed to answer the question correctly. Could it be how I’m uploading/encoding the image??
