# PyMarker
A python package to manage Augmented Reality markers and patterns based on input images. This package is capable of generating black borders around images to be used as AR markers and also removing them in cases where you need to automatize the process.
## Installation
PyMarker is available through pip and [Pypi](https://pypi.org/project/pymarker/).
```bash
python3 -m pip install pymarker --user
// or
pip3 install pymarker --user
```
## Usage
Pymarker provides three features for a marker-based AR: generating Pattern files (.patt); Markers images (.png); Removing borders of existing Marker images. The marker will be used by the user to visualize some augmented reality, the pattern file for the system to be able to recognize the marker.
An example input image:

Expected output patt:

Expected output marker:

Using the remove feature, we can return this marker to the starter image back again:

### Commands
PyMarker now uses subcommands for its CLI interface.
#### Generate markers and patt files
By default, the `generate` subcommand receives an image and generates both patt and marker files:
```bash
$ pymarker generate tests/input/hiro.jpg
```
To generate only the patt file for the input, use the `-p` or `--patt` flag:
```bash
$ pymarker generate -p tests/input/hiro.jpg
# or
$ pymarker generate --patt tests/input/hiro.jpg
```
To generate only the marker, use the `-m` or `--marker` flag:
```bash
$ pymarker generate -m tests/input/hiro.jpg
# or
$ pymarker generate --marker tests/input/hiro.jpg
```
You can adjust the marker border size with `-b` (black border, default 20%) and `-w` (white border, default 3%):
```bash
$ pymarker generate -b 40 -w 5 tests/input/hiro.jpg
```
You can also specify an output path with `-o` or `--output`:
```bash
$ pymarker generate -o output_dir/ tests/input/hiro.jpg
```
#### Remove borders from marker images
To remove borders from a marker image, use the `remove` subcommand:
```bash
$ pymarker remove tests/input/marker.png
```
You can specify an output path for the result:
```bash
$ pymarker remove -o output_dir/ tests/input/marker.png
```
### Modules
You can use the functions directly from your python code to generate markers and patts.
```python
from pymarker.core import generate_patt, generate_marker
def main():
filename = "tests/input/hiro.jpg"
border_size = 50 // size in percentage
generate_patt(filename)
generate_marker(filename,border_size)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/pablodiegoss/pymarker",
"name": "pymarker",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "AR, pattern, markers, jandig, hiro",
"author": "Pablo Silva",
"author_email": "pablodiegoss@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/13/a5/9d8c8959db21ccb498806dc538c7290aef7444d1e7de4e2c707c91f38999/pymarker-1.2.0.tar.gz",
"platform": null,
"description": "# PyMarker\n\nA python package to manage Augmented Reality markers and patterns based on input images. This package is capable of generating black borders around images to be used as AR markers and also removing them in cases where you need to automatize the process.\n\n## Installation\n\nPyMarker is available through pip and [Pypi](https://pypi.org/project/pymarker/).\n\n```bash\npython3 -m pip install pymarker --user\n// or\npip3 install pymarker --user\n```\n\n## Usage\n\nPymarker provides three features for a marker-based AR: generating Pattern files (.patt); Markers images (.png); Removing borders of existing Marker images. The marker will be used by the user to visualize some augmented reality, the pattern file for the system to be able to recognize the marker.\n\nAn example input image:\n\n\n\nExpected output patt:\n\n\n\nExpected output marker:\n\n\n\nUsing the remove feature, we can return this marker to the starter image back again:\n\n\n\n### Commands\n\nPyMarker now uses subcommands for its CLI interface.\n\n#### Generate markers and patt files\n\nBy default, the `generate` subcommand receives an image and generates both patt and marker files:\n\n```bash\n$ pymarker generate tests/input/hiro.jpg\n```\n\nTo generate only the patt file for the input, use the `-p` or `--patt` flag:\n\n```bash\n$ pymarker generate -p tests/input/hiro.jpg\n# or\n$ pymarker generate --patt tests/input/hiro.jpg\n```\n\nTo generate only the marker, use the `-m` or `--marker` flag:\n\n```bash\n$ pymarker generate -m tests/input/hiro.jpg\n# or\n$ pymarker generate --marker tests/input/hiro.jpg\n```\n\nYou can adjust the marker border size with `-b` (black border, default 20%) and `-w` (white border, default 3%):\n\n```bash\n$ pymarker generate -b 40 -w 5 tests/input/hiro.jpg\n```\n\nYou can also specify an output path with `-o` or `--output`:\n\n```bash\n$ pymarker generate -o output_dir/ tests/input/hiro.jpg\n```\n\n#### Remove borders from marker images\n\nTo remove borders from a marker image, use the `remove` subcommand:\n\n```bash\n$ pymarker remove tests/input/marker.png\n```\n\nYou can specify an output path for the result:\n\n```bash\n$ pymarker remove -o output_dir/ tests/input/marker.png\n```\n\n### Modules\n\nYou can use the functions directly from your python code to generate markers and patts.\n\n```python\nfrom pymarker.core import generate_patt, generate_marker\n\ndef main():\n filename = \"tests/input/hiro.jpg\"\n border_size = 50 // size in percentage\n\n generate_patt(filename)\n generate_marker(filename,border_size)\n\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A python package to generate AR markers and patterns based on input images",
"version": "1.2.0",
"project_urls": {
"Homepage": "https://github.com/pablodiegoss/pymarker",
"Repository": "https://github.com/pablodiegoss/pymarker"
},
"split_keywords": [
"ar",
" pattern",
" markers",
" jandig",
" hiro"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "df0c67c8dbe2e1f67732601a41c7806a738c500d29c6336df61540414fbec215",
"md5": "a2de869300b148b820dba74f8f4de448",
"sha256": "0e80d37ba3b890040674d28fa1a9f13405e2dd71a615444092a831f6fc48dd60"
},
"downloads": -1,
"filename": "pymarker-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a2de869300b148b820dba74f8f4de448",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 19919,
"upload_time": "2025-07-12T18:42:20",
"upload_time_iso_8601": "2025-07-12T18:42:20.319210Z",
"url": "https://files.pythonhosted.org/packages/df/0c/67c8dbe2e1f67732601a41c7806a738c500d29c6336df61540414fbec215/pymarker-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "13a59d8c8959db21ccb498806dc538c7290aef7444d1e7de4e2c707c91f38999",
"md5": "9b406b2d1c4a7144215da37f34043940",
"sha256": "af285af1326d1f8c1ea74886d51f7e122dc18a7d73bf75675cff43d5ed873781"
},
"downloads": -1,
"filename": "pymarker-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "9b406b2d1c4a7144215da37f34043940",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 18357,
"upload_time": "2025-07-12T18:42:21",
"upload_time_iso_8601": "2025-07-12T18:42:21.622423Z",
"url": "https://files.pythonhosted.org/packages/13/a5/9d8c8959db21ccb498806dc538c7290aef7444d1e7de4e2c707c91f38999/pymarker-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-12 18:42:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pablodiegoss",
"github_project": "pymarker",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pymarker"
}