Top-Left pixel in a file...

Do you need help installing or using ZunTzu? Would you like to report a bug?

Moderators: Ichibrothers, Cambronne

Post Reply
User avatar
Pokke
021
Posts: 58
Joined: 15 Jan 2009, 23:34

Top-Left pixel in a file...

Post by Pokke »

Is the very first pixel in an image file located at (0,0) or (1,1) ?

And does that matter?
DCelso
Posts: 8
Joined: 26 Apr 2009, 23:52

Post by DCelso »

I don`t know exactly,but it must be (0,0). In all examples that I saw always is 0,0.
User avatar
Pokke
021
Posts: 58
Joined: 15 Jan 2009, 23:34

Post 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...
User avatar
Jerome
Site Admin
Posts: 974
Joined: 22 Jun 2006, 21:31
Location: France
Contact:

Post 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".
Jerome, ZunTzu developer.
Post Reply