<p>It comes down to history. The original interfaces for drawing stuff on the screen were for text, not images. Since the people who designed those early computers spoke languages that are read left-to-right, top-to-bottom, it made sense for the first glyph to be the top-left one. This also works conveniently with how the image was transmitted to the display. TV signals also start in the top-left, so those CRT displays also started displaying a frame with the top-left pixel. When computers added "graphics modes" to their "text modes", it made sense for the origin to stay in the same place. </p>

<p>This all changed with packages specifically designed for mathematical and scientific computing. Charts are usually drawn with (0,0) at the bottom-left, so scientists wanted their co-ordinate system to work that way.</p>

<p>This is why we have two common options. Generally for an image format, it depends on the use-case the format was originally designed to satisfy, and what kind of people worked on it. Image formats are usually designed by engineers with experience of low-level graphics implementation, so top-down is more popular, but some formats support both for flexibility.</p>

CC BY-SA 4.0
2018-10-25T18:02:18.193Z
2018-10-25T18:02:18.193Z
Dan Hulme
<p>It seems that every image format (jpeg, png, tiff, bmp, jp2000...) doesn't place their origin at the same corner.</p>

<p>Do you know where I could find some info about this differences?</p>

<p>I can only say that PNG and JPEG are different.</p>

CC BY-SA 4.0
2018-10-24T08:40:11.760Z
Are you asking "why is pixel 0,0 at the *top* left of some formats and *bottom* left of others?" If so, the short answer is probably that _a)_ some formats simply mimic the way raster scanning for displays (particularly CRTs) is performed - the HW reads teh pixel data in memory in increasing address order and sends to the display from top row to bottom row, and left to right within each row.  For _b)_ I suspect some formats wanted to mimic how humans draw graphs, with (0,0) at the bottom left and the Y-axis going up the screen.
Simon F
CC BY-SA 4.0
2018-10-24T10:23:47.347Z
It is exactly what I wanted to ask... I take your proposal of title. jpg seems to be the only one different from other formats (tiff, png, jp2000, bmp...).
Sandburg
CC BY-SA 4.0
2018-10-24T13:52:22.660Z
According to https://en.wikipedia.org/wiki/BMP_file_format#Pixel_array_(bitmap_data) BMPs are also bottom to top.
Simon F
CC BY-SA 4.0
2018-10-24T17:00:10.367Z
There has to be some standard for this. I don't know why I personally feel top left to be (0,0) and bottom right as (200,200). Perhaps, due to Khan Academy's usage of `processing.js`
MisterGeeky
CC BY-SA 4.0
2018-10-24T17:05:30.667Z
MIT Scratch has a similar co-ordinate system. So, my guess is that format developers worked in different graphic environments that influenced their decision on where to place origin. I feel left corner positions appropriate because it helps people stick to positive numbers and also LTR progression (ie, 0<1<2<3). Negative numbers take one more bit to store sometimes, or you have do some weird number inversion (ie, compliment). All in all, LOGO taught kids to move from center to different directions, assuming each new position as starting point, I feel that's where a lot of people got intuition.
MisterGeeky
<2d><data-structure>
Why is pixel 0,0 at the top left of some formats and bottom left of others?
Sandburg
# Why is pixel 0,0 at the top left of some formats and bottom left of others?

(Asked by: username_0 on 2018-10-23)

It seems that every image format (jpeg, png, tiff, bmp, jp2000...) doesn't place their origin at the same corner.

Do you know where I could find some info about this differences?

I can only say that PNG and JPEG are different.

**Tags:** 2d, data-structure

> **Comments:**
> **username_1**: Are you asking "why is pixel 0,0 at the *top* left of some formats and *bottom* left of others?" If so, the short answer is probably that _a)_ some formats simply mimic the way raster scanning for displays (particularly CRTs) is performed - the HW reads teh pixel data in memory in increasing address order and sends to the display from top row to bottom row, and left to right within each row.  For _b)_ I suspect some formats wanted to mimic how humans draw graphs, with (0,0) at the bottom left and the Y-axis going up the screen.  
> **username_0**: It is exactly what I wanted to ask... I take your proposal of title. jpg seems to be the only one different from other formats (tiff, png, jp2000, bmp...).  
> **username_1**: According to https://en.wikipedia.org/wiki/BMP_file_format#Pixel_array_(bitmap_data) BMPs are also bottom to top.  
> **username_2**: There has to be some standard for this. I don't know why I personally feel top left to be (0,0) and bottom right as (200,200). Perhaps, due to Khan Academy's usage of `processing.js`  
> **username_2**: MIT Scratch has a similar co-ordinate system. So, my guess is that format developers worked in different graphic environments that influenced their decision on where to place origin. I feel left corner positions appropriate because it helps people stick to positive numbers and also LTR progression (ie, 0<1<2<3). Negative numbers take one more bit to store sometimes, or you have do some weird number inversion (ie, compliment). All in all, LOGO taught kids to move from center to different directions, assuming each new position as starting point, I feel that's where a lot of people got intuition.  

---

## 1 answers

### Answer by username_3 on 2018-10-25. Score: 4 | Accepted answer

It comes down to history. The original interfaces for drawing stuff on the screen were for text, not images. Since the people who designed those early computers spoke languages that are read left-to-right, top-to-bottom, it made sense for the first glyph to be the top-left one. This also works conveniently with how the image was transmitted to the display. TV signals also start in the top-left, so those CRT displays also started displaying a frame with the top-left pixel. When computers added "graphics modes" to their "text modes", it made sense for the origin to stay in the same place.

This all changed with packages specifically designed for mathematical and scientific computing. Charts are usually drawn with (0,0) at the bottom-left, so scientists wanted their co-ordinate system to work that way.

This is why we have two common options. Generally for an image format, it depends on the use-case the format was originally designed to satisfy, and what kind of people worked on it. Image formats are usually designed by engineers with experience of low-level graphics implementation, so top-down is more popular, but some formats support both for flexibility.


---

