Skip to content

Commit 34eec4c

Browse files
docs: explain image coordinates in getting started (#96)
1 parent 5838a14 commit 34eec4c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/Basics/Working with Images.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ In the context of digital technology and computing, images are represented as a
1919
| **Can be loaded in this format** | ✅ | ✅ | ✅ |
2020
| **Can be saved in this format** | ❌ | ✅ | ✅ |
2121

22+
### Image coordinates
23+
24+
The origin point has coordinates (0,0) and is located in the top-left corner of an image.
25+
26+
![Image coordinates](./workingWithImages/coordinatesImage.jpg)
27+
28+
So, if we want to get a certain pixel on the image we will be counting the distance from image's top-left corner.
29+
30+
```ts
31+
//We will receive 20th row and 10th column
32+
//from the top-left corner.
33+
const pixel = image.getPixel(10, 20);
34+
```
35+
2236
### Properties
2337

2438
In ImageJS main properties of an image are:
15.4 KB
Loading

0 commit comments

Comments
 (0)