Page 1 of 1

Top-Left pixel in a file...

Posted: 28 Apr 2009, 17:57
by Pokke
Is the very first pixel in an image file located at (0,0) or (1,1) ?

And does that matter?

Posted: 28 Apr 2009, 23:21
by DCelso
I don`t know exactly,but it must be (0,0). In all examples that I saw always is 0,0.

Posted: 29 Apr 2009, 08:13
by Pokke
DCelso wrote:I don`t know exactly,but it must be (0,0). In all examples that I saw always is 0,0.
Yes, that's why I asked. In the samples it's always (0,0). But I always set it at (1,1) in my gamemodules and that seems to work fine as well.

You see: If you set the first pixel at (0,0) and your image is 100x100 wide, where is the bottom-right pixel?

Is that at (100,100), which means that you end up with an image 101x101 pixels long because you have to add one for that 0,0 value.
Or is it at (99,99), which means that you always have to deduct 1 from the values that you can read in photoshop for width and height.

I always take the values from the photoshop info window, so now I wonder if I have a one pixel shift to the right and the bottom by doing that.
I can't see that on my counters, so I got curious...

Posted: 28 May 2009, 07:16
by Jerome
Pokke wrote:If you set the first pixel at (0,0) and your image is 100x100 wide, where is the bottom-right pixel?
Good question.
The bottom-right pixel would be 100x100. The top-left pixel is "included". The bottom-right pixel is "not included".