{"id":16971658,"url":"https://github.com/juancarlospaco/netpbm","last_synced_at":"2026-03-01T16:04:36.701Z","repository":{"id":57445672,"uuid":"85917212","full_name":"juancarlospaco/netpbm","owner":"juancarlospaco","description":"NetPBM Raster Bitmap Pure Python 3 Image, No dependencies, Color, Grayscale or Black\u0026White, Object, Encoder and Decoder, PNG Export, JSON Import/Export, and other useful manipulation functions. Uses native Python lists.","archived":false,"fork":false,"pushed_at":"2017-06-24T10:33:16.000Z","size":469,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-31T09:33:48.808Z","etag":null,"topics":["image-processing","netpbm","python3"],"latest_commit_sha":null,"homepage":"https://en.wikipedia.org/wiki/Netpbm_format#PPM_example","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juancarlospaco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-23T06:57:51.000Z","updated_at":"2022-10-24T23:38:26.000Z","dependencies_parsed_at":"2022-09-26T17:30:27.449Z","dependency_job_id":null,"html_url":"https://github.com/juancarlospaco/netpbm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/juancarlospaco/netpbm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnetpbm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnetpbm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnetpbm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnetpbm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juancarlospaco","download_url":"https://codeload.github.com/juancarlospaco/netpbm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnetpbm/sbom","scorecard":{"id":540428,"data":{"date":"2025-08-11","repo":{"name":"github.com/juancarlospaco/netpbm","commit":"c934c93f2d0a92f65a41fd60badcf5393a048c3a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-20T08:04:42.833Z","repository_id":57445672,"created_at":"2025-08-20T08:04:42.833Z","updated_at":"2025-08-20T08:04:42.833Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29974336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T15:41:30.362Z","status":"ssl_error","status_checked_at":"2026-03-01T15:37:07.343Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-processing","netpbm","python3"],"created_at":"2024-10-14T00:53:26.291Z","updated_at":"2026-03-01T16:04:36.680Z","avatar_url":"https://github.com/juancarlospaco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# netpbm\n\n**NetPBM Raster Bitmap Pure Python 3.**\n\n[![GPL License](http://img.shields.io/badge/license-GPL-blue.svg)](http://opensource.org/licenses/GPL-3.0)\n[![LGPL License](http://img.shields.io/badge/license-LGPL-blue.svg)](http://opensource.org/licenses/LGPL-3.0)\n[![Python Version](https://img.shields.io/badge/Python-3-brightgreen.svg)](http://python.org)\n\n- No dependencies, Python 3.5+ standard libs only.\n- No Pillow, No PIL, No Numpy, No Matplotlib, No Compilation required.\n- Color (16M Colors), Grayscale (256 Colors) or Black\u0026White (2 Colors).\n- Object Class is Encoder and Decoder, `with` context manager support, chaining.\n- PNG Export, JSON Import/Export, Pretty-Print to Terminal, etc.\n- Useful manipulation functions, Darken, Lighten, Invert, Crop, Shrink, etc.\n- Uses simple native Python lists, No Numpy Arrays.\n- Single file.\n\nFor more information on the Standard see: https://en.wikipedia.org/wiki/Netpbm_format#PPM_example\n\n\n# Examples\n\n![Procedural](https://raw.githubusercontent.com/juancarlospaco/netpbm/master/example.jpg)\n\n![Fractal](https://raw.githubusercontent.com/juancarlospaco/netpbm/master/fractalito.jpeg)\n\n![Fractal](https://raw.githubusercontent.com/juancarlospaco/netpbm/master/fractalito_Vicsek.jpeg)\n\n![Fractal](https://raw.githubusercontent.com/juancarlospaco/netpbm/master/fractalito_hexaflake.jpg)\n\n![Fractal](https://raw.githubusercontent.com/juancarlospaco/netpbm/master/fractalito_snowflake.jpeg)\n\n![Fractal](https://raw.githubusercontent.com/juancarlospaco/netpbm/master/fractalito_spiral.jpeg)\n\n![Fractal](https://raw.githubusercontent.com/juancarlospaco/netpbm/master/fractalito_tri.jpeg)\n\nCheck [the Example file for fractal code](https://github.com/juancarlospaco/netpbm/blob/master/example_fractals.py).\n\n\n# Reference\n\n\n- The Documentation uses `ImgColor` as Example, but `ImgGrayscale` and `ImgBW` share the same functions, since they all inherit from the same internal-only `__Bitmap` Dummy Base Private Class.\n- Encoding is always `utf-8` for proper Unicode support, unless explicitly stated otherwise.\n\n##### ImgColor\n\u003cdetails\u003e\n\n`netpbm.ImgColor(width: int, height: int, bitmap: list, bg: int=0, comment: str=\"\")`\n\n**Description:** Make an Image object.\n\n**Arguments:**\n- `width` Width of Image, required, integer type.\n- `height` Height of Image, required, integer type.\n- `bitmap` A List of Lists with RGB values `[ [(R,G,B), ... ], ... ]` eg.`[ [(255,0,128), (10,0,250),], ]`, basically a Matrix of Integers, optional, a Blank image will be created if not provided, list type.\n- `bg` Default Background color, optional, a Blank Background image will be used if not provided, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`.\n- `comment` Comment for Image, optional, an Empty string will be used if not provided, string type.\n\n**Keyword Arguments:** None.\n\n**Returns:** `ImgColor` object, a Color Image.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e ImgColor(10, 10)\n```\n\u003c/details\u003e\n\n\n\n##### show\n\u003cdetails\u003e\n\n`netpbm.ImgColor.show()`\n\n**Description:** Opens Image with browser or default program, auto-converts to PNG.\n\n**Arguments:** None.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image = ImgColor(10, 10)\n\u003e\u003e\u003e image.show()\n```\n\u003c/details\u003e\n\n\n\n##### from_string\n\u003cdetails\u003e\n\n`netpbm.ImgColor.from_string(stringy: str)`\n\n**Description:** Get Bitmap data from a string.\nThis first get contents as a UTF-8 string, removes all empty lines, strips the string,\ngets Header data using a Regex, which includes Height of Bitmap,\nthen it slices lines from string from bottom to top according to Height, that gives the Bitmap data from the string slice,\nmake all strings to integers and sets them as Bitmap, returns that Bitmap.\n\n**Arguments:**\n- `stringy` A string with a valid image file, required, string type.\n\n**Keyword Arguments:** None.\n\n**Returns:** A Bitmap, a list of lists.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.from_string(open(\"image.ppm\").read())\n```\n\u003c/details\u003e\n\n\n\n##### from_file\n\u003cdetails\u003e\n\n`netpbm.ImgColor.from_file(filepath: str)`\n\n**Description:** Get Bitmap data from an existent valid file path string.\nInternally is a shortcut to `netpbm.ImgColor.from_string()` that opens and reads the file.\n\n**Arguments:**\n- `filepath` A string with an existent valid image file path, required, string type.\n\n**Keyword Arguments:** None.\n\n**Returns:** A Bitmap, a list of lists.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.from_file(\"image.ppm\")\n```\n\u003c/details\u003e\n\n\n\n##### get_header\n\u003cdetails\u003e\n\n`netpbm.ImgColor.get_header(data_str: str)`\n\n**Description:** Get Header data using a Regex from an string.\nSets Header. Returns Header.\n\n**Arguments:**\n- `data_str` A string with an valid image file contents, required, string type.\n\n**Keyword Arguments:** None.\n\n**Returns:** A Header, one of `\"P1\"`, `\"P2\"`, `\"P3\"`, string type.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.get_header(open(\"image.ppm\").read())\n```\n\u003c/details\u003e\n\n\n\n##### get_mime_type\n\u003cdetails\u003e\n\n`netpbm.ImgColor.get_mime_type()`\n\n**Description:** Get the mime type of the current image format as `'type/subtype'`.\nInternally it uses Python standard libs `mimetypes.guess_type()`.\n\n**Arguments:** None.\n\n**Keyword Arguments:** None.\n\n**Returns:** A MIME Type, string type.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.get_mime_type()\n```\n\u003c/details\u003e\n\n\n\n##### pprint\n\u003cdetails\u003e\n\n`netpbm.ImgColor.pprint()`\n\n**Description:** Pretty Print to standard output the bitmap data matrix, a list of lists.\nInternally it uses Pythons standard libs `pprint.pprint()`.\n\n**Arguments:** None.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.pprint()\n```\n\u003c/details\u003e\n\n\n\n##### set_datetime_as_comment\n\u003cdetails\u003e\n\n`netpbm.ImgColor.set_datetime_as_comment()`\n\n**Description:** Set actual date and time UTC-aware ISO-Format as the comment.\neg. `'2017-03-24 07:49:57-03:00'`.\nInternally is shortcut to `datetime.datetime.now(datetime.timezone.utc).replace(\n    microsecond=0).astimezone().isoformat(\" \")`.\n\n**Arguments:** None.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.set_datetime_as_comment()\n```\n\u003c/details\u003e\n\n\n\n##### mirror_x\n\u003cdetails\u003e\n\n`netpbm.ImgColor.mirror_x()`\n\n**Description:** Mirror image Horizontally.\n\n**Arguments:** None.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.mirror_x()\n```\n\u003c/details\u003e\n\n\n\n##### mirror_y\n\u003cdetails\u003e\n\n`netpbm.ImgColor.mirror_y()`\n\n**Description:** Mirror image Vertically.\n\n**Arguments:** None.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.mirror_y()\n```\n\u003c/details\u003e\n\n\n\n##### crop_x\n\u003cdetails\u003e\n\n`netpbm.ImgColor.crop_x(x: int)`\n\n**Description:** Crop image Horizontally, crops from right-bottom, only can reduce size.\nThis can not resize the contents, only crops the canvas.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.crop_x(5)\n```\n\u003c/details\u003e\n\n\n\n##### crop_y\n\u003cdetails\u003e\n\n`netpbm.ImgColor.crop_y(y: int)`\n\n**Description:** Crop image Vertically, crops from right-bottom, only can reduce size.\nThis can not resize the contents, only crops the canvas.\n\n**Arguments:**\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.crop_y(6)\n```\n\u003c/details\u003e\n\n\n\n##### crop\n\u003cdetails\u003e\n\n`netpbm.ImgColor.crop(x: int, y: int)`\n\n**Description:** Crop image Horizontally and Vertically, crops from right-bottom, only can reduce size.\nThis can not resize the contents, only crops the canvas.\nInternally is a shortcut to `crop_x()` and `crop_y()`.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.crop(6, 6)\n```\n\u003c/details\u003e\n\n\n\n##### crop_centered_x\n\u003cdetails\u003e\n\n`netpbm.ImgColor.crop_centered_x(x: int)`\n\n**Description:** Centered Crop image Horizontally, crops from borders instead of from bottom-right, can  only reduce size.\nThis can not resize the contents, only crops the canvas.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.crop_centered_x(6)\n```\n\u003c/details\u003e\n\n\n\n##### crop_centered_y\n\u003cdetails\u003e\n\n`netpbm.ImgColor.crop_centered_y(y: int)`\n\n**Description:** Centered Crop image Vertically, crops from borders instead of from bottom-right, can  only reduce size.\nThis can not resize the contents, only crops the canvas.\n\n**Arguments:**\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.crop_centered_y(6)\n```\n\u003c/details\u003e\n\n\n\n##### crop_centered\n\u003cdetails\u003e\n\n`netpbm.ImgColor.crop_centered(x: int, y: int)`\n\n**Description:** Centered Crop image Horizontally and Vertically, crops from borders instead of from bottom-right, can  only reduce size.\nThis can not resize the contents, only crops the canvas.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.crop_centered(6, 6)\n```\n\u003c/details\u003e\n\n\n\n##### expand_x\n\u003cdetails\u003e\n\n`netpbm.ImgColor.expand_x(x: int)`\n\n**Description:** Expand image Horizontally, grow from right-bottom, increments size.\nThis can not resize the contents, only expands the canvas.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.expand_x(14)\n```\n\u003c/details\u003e\n\n\n\n##### expand_y\n\u003cdetails\u003e\n\n`netpbm.ImgColor.expand_y(y: int)`\n\n**Description:** Expand image Vertically, grow from right-bottom, increments size.\nIt only resizes the canvas.\nThis can not resize the contents, only expands the canvas.\n\n**Arguments:**\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.expand_y(14)\n```\n\u003c/details\u003e\n\n\n\n##### expand\n\u003cdetails\u003e\n\n`netpbm.ImgColor.expand(x: int, y: int)`\n\n**Description:** Expand image Horizontally and Vertically, grow from right-bottom, increments size.\nInternally is shortcut to `expand_x()` and `expand_y()`.\nThis can not resize the contents, only expands the canvas.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.expand(14, 14)\n```\n\u003c/details\u003e\n\n\n\n##### expand_centered_x\n\u003cdetails\u003e\n\n`netpbm.ImgColor.expand_centered_x(x: int)`\n\n**Description:** Expand image centered Horizontally, grow from right-bottom, increments size.\nThis can not resize the contents, only expands the canvas.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.expand_centered_x(14)\n```\n\u003c/details\u003e\n\n\n\n##### expand_centered_y\n\u003cdetails\u003e\n\n`netpbm.ImgColor.expand_centered_y(y: int)`\n\n**Description:** Expand image Centered Vertically, grow from right-bottom, increments size.\nThis can not resize the contents, only expands the canvas.\n\n**Arguments:**\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.expand_centered_y(14)\n```\n\u003c/details\u003e\n\n\n\n##### expand_centered\n\u003cdetails\u003e\n\n`netpbm.ImgColor.expand_centered(x: int, y: int)`\n\n**Description:** Expand image Centered Horizontally and Vertically, grow from right-bottom, increments size. This can not resize the contents, only expands the canvas.\nInternally is shortcut to `expand_centered_x()` and `expand_centered_y()`.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.expand_centered(14, 14)\n```\n\u003c/details\u003e\n\n\n\n##### shrink_x\n\u003cdetails\u003e\n\n`netpbm.ImgColor.shrink_x(x: int)`\n\n**Description:** Shrink image horizontally.\nIt resizes the Bitmap contents itself AND resizes the canvas too. Can only reduce sizes.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.shrink_x(6)\n```\n\u003c/details\u003e\n\n\n\n##### shrink_y\n\u003cdetails\u003e\n\n`netpbm.ImgColor.shrink_y(y: int)`\n\n**Description:** Shrink image vertically.\nIt resizes the Bitmap contents itself AND resizes the canvas too. Can only reduce sizes.\n\n**Arguments:**\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.shrink_y(6)\n```\n\u003c/details\u003e\n\n\n\n##### shrink\n\u003cdetails\u003e\n\n`netpbm.ImgColor.shrink(x: int, y: int)`\n\n**Description:** Shrink image horizontally and vertically.\nIt resizes the Bitmap contents itself AND resizes the canvas too. Can only reduce sizes.\nInternally is shortcut to `shrink_x()` and `shrink_y()`.\n\n**Arguments:**\n- `x` New Width for the Image, required, integer type.\n- `y` New Height for the Image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.shrink(8, 6)\n```\n\u003c/details\u003e\n\n\n\n##### lighten\n\u003cdetails\u003e\n\n`netpbm.ImgColor.lighten(amount: int)`\n\n**Description:** Lighten the image according to amount argument.\nDo nothing on Black\u0026White images.\nLets imagine your Pixel RGB is `(0, 128, 255)` you set `amount` to `10`,\nthen it will add `10` to each integer, always on valid limits of `0` or `255`,\nthen your RGB is `(10, 138, 255)`.\n\n**Arguments:**\n- `amount` The amount of lightening to apply to the image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.lighten(2)\n```\n\u003c/details\u003e\n\n\n\n##### darken\n\u003cdetails\u003e\n\n`netpbm.ImgColor.darken(amount: int)`\n\n**Description:** Darken the image according to amount argument.\nDo nothing on Black\u0026White images.\nLets imagine your Pixel RGB is `(0, 128, 255)` you set `amount` to `10`,\nthen it will substract `10` to each integer, always on valid limits of `0` or `255`,\nthen your RGB is `(0, 118, 245)`.\n\n**Arguments:**\n- `amount` The amount of darkening to apply to the image, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.darken(2)\n```\n\u003c/details\u003e\n\n\n\n##### fillrect\n\u003cdetails\u003e\n\n`netpbm.ImgColor.fillrect( x: int, y: int, width: int, height: int, color: list=None)`\n\n**Description:** Fill up a rectangle or square on the image with given color.\nIf no `color` provided then default background color will be used.\n\n**Arguments:**\n- `x` Position on the horizontal X axis on the canvas, required, integer type.\n- `y` Position on the vertical Y axis on the canvas, required, integer type.\n- `width` Width of the rectangle or square, required, integer type.\n- `height` Height of the rectangle or square, required, integer type.\n- `color` Color of the rectangle or square, optional,\ndefault background color will be used if not provided, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.fillrect(2, 2, 4, 4, [128, 128, 128])\n```\n\u003c/details\u003e\n\n\n\n##### fillrect_stripe_x\n\u003cdetails\u003e\n\n`netpbm.ImgColor.fillrect_stripe_x( x: int, y: int, width: int, height: int, color0: list, color1: list, stroke: int)`\n\n**Description:** Fill up a rectangle or square on the image with given colors\nusing an stripped horizontal pattern of lines of given stroke thickness.\nRequires 2 colors for the stripped pattern.\n\n**Arguments:**\n- `x` Position on the horizontal X axis on the canvas, required, integer type.\n- `y` Position on the vertical Y axis on the canvas, required, integer type.\n- `width` Width of the rectangle or square, required, integer type.\n- `height` Height of the rectangle or square, required, integer type.\n- `color0` Color of the rectangle or square, required, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n- `color1` Color of the rectangle or square, required, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n- `stroke` Stroke of thickness of the stripped pattern lines, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.fillrect_stripe_x(2, 2, 4, 4, [128, 128, 128], [99, 99, 99], 2)\n```\n\u003c/details\u003e\n\n\n\n##### fillrect_stripe_y\n\u003cdetails\u003e\n\n`netpbm.ImgColor.fillrect_stripe_y( x: int, y: int, width: int, height: int, color0: list, color1: list, stroke: int)`\n\n**Description:** Fill up a rectangle or square on the image with given colors\nusing an stripped vertical pattern of lines of given stroke thickness.\nRequires 2 colors for the stripped pattern.\n\n**Arguments:**\n- `x` Position on the horizontal X axis on the canvas, required, integer type.\n- `y` Position on the vertical Y axis on the canvas, required, integer type.\n- `width` Width of the rectangle or square, required, integer type.\n- `height` Height of the rectangle or square, required, integer type.\n- `color0` Color of the rectangle or square, required, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n- `color1` Color of the rectangle or square, required, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n- `stroke` Stroke of thickness of the stripped pattern lines, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.fillrect_stripe_y(2, 2, 4, 4, [128, 128, 128], [99, 99, 99], 2)\n```\n\u003c/details\u003e\n\n\n\n##### fillrect_grid\n\u003cdetails\u003e\n\n`netpbm.ImgColor.fillrect_grid( x: int, y: int, width: int, height: int, color0: list, color1: list, stroke: int)`\n\n**Description:** Fill up a rectangle or square on the image with given colors\nusing a Grid pattern of horizontal and vertical lines of given stroke thickness.\nRequires 2 colors for the grid pattern.\n\n**Arguments:**\n- `x` Position on the horizontal X axis on the canvas, required, integer type.\n- `y` Position on the vertical Y axis on the canvas, required, integer type.\n- `width` Width of the rectangle or square, required, integer type.\n- `height` Height of the rectangle or square, required, integer type.\n- `color0` Color of the rectangle or square, required, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n- `color1` Color of the rectangle or square, required, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n- `stroke` Stroke of thickness of the grid pattern lines, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.fillrect_grid(2, 2, 4, 4, [128, 128, 128], [99, 99, 99], 2)\n```\n\u003c/details\u003e\n\n\n\n##### fillrect_dotted\n\u003cdetails\u003e\n\n`netpbm.ImgColor.fillrect_dotted( x: int, y: int, width: int, height: int, color0: list, color1: list, stroke: int)`\n\n**Description:** Fill up a rectangle or square on the image with given colors\nusing a Dotted pattern of horizontal and vertical Dots of given stroke thickness.\nRequires 2 colors for the Dotted pattern.\n\n**Arguments:**\n- `x` Position on the horizontal X axis on the canvas, required, integer type.\n- `y` Position on the vertical Y axis on the canvas, required, integer type.\n- `width` Width of the rectangle or square, required, integer type.\n- `height` Height of the rectangle or square, required, integer type.\n- `color0` Color of the rectangle or square, required, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n- `color1` Color of the rectangle or square, required, list type for Color images, eg `[0,0,0]`, integer for Black\u0026White and Grayscale images, eg `0`..\n- `stroke` Stroke of thickness of the Dot pattern, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.fillrect_dotted(2, 2, 4, 4, [128, 128, 128], [99, 99, 99], 2)\n```\n\u003c/details\u003e\n\n\n\n##### fillrect_random\n\u003cdetails\u003e\n\n`netpbm.ImgColor.fillrect_random( x: int, y: int, width: int, height: int)`\n\n**Description:** Fill up a rectangle or square on the image with Random colors\nusing a Random pattern of Random Pixels.\n\n**Arguments:**\n- `x` Position on the horizontal X axis on the canvas, required, integer type.\n- `y` Position on the vertical Y axis on the canvas, required, integer type.\n- `width` Width of the rectangle or square, required, integer type.\n- `height` Height of the rectangle or square, required, integer type.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.fillrect_random(2, 2, 4, 4)\n```\n\u003c/details\u003e\n\n\n\n##### to_file\n\u003cdetails\u003e\n\n`netpbm.ImgColor.to_file(fyle: str)`\n\n**Description:** Write everything to a file.\nWrite the full contents of the actual current Image instance to a local file full path string of proper format and extension.\nFile extension will be added automatically if file extension is not provided.\nFile extension will be added automatically if file extension is not correct.\nFile extension for Black\u0026White images is `*.pbm`.\nFile extension for Grayscale images is `*.ppm`.\nFile extension for Color images is `*.pgm`.\n\n**Arguments:**\n- `fyle` local file path string of proper format and extension.\n\n**Keyword Arguments:** None.\n\n**Returns:** Local file path string of new file created.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.to_file(\"my_image_file\")\n```\n\u003c/details\u003e\n\n\n\n##### to_png\n\u003cdetails\u003e\n\n`netpbm.ImgColor.to_png(fyle: str)`\n\n**Description:** Write everything to a PNG file.\nWrite the full contents of the actual current Image instance to a local file full path string of `*.PNG` format and extension.\nFile extension will be added automatically if file extension is not provided.\nFile extension will be added automatically if file extension is not correct.\nThis uses `pnm2png` executable command line program of the system.\n`pnm2png` executable must be working Ok on the system.\n\n**Arguments:**\n- `fyle` local file path string of `*.PNG` file extension.\n\n**Keyword Arguments:** None.\n\n**Returns:** Local file path string of new `*.PNG` file created.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :question:         | **Os X**    | Unknown     |\n| :question:         | **Windows** | Unknown     |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.to_png(\"my_png_image_file\")\n```\n\u003c/details\u003e\n\n\n\n##### to_json\n\u003cdetails\u003e\n\n`netpbm.ImgColor.to_json(fyle: str=None)`\n\n**Description:** Write everything to a JSON string, file or standard output.\nWrite the full contents of the actual current Image instance to a local JSON file full path string of `*.json` file extension.\nFile extension will be added automatically if file extension is not provided.\nFile extension will be added automatically if file extension is not correct.\nIf `fyle` is not provided then it will return the JSON. This serializes data to JSON.\n\n**Arguments:**\n- `fyle` local file path string of `*.json` file extension.\nIf not provided then it will return the JSON.\n\n**Keyword Arguments:** None.\n\n**Returns:** Local file path string of new `*.json` file created or the JSON string itself.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.to_json(\"my_json_file\")\n```\n\u003c/details\u003e\n\n\n\n##### from_json\n\u003cdetails\u003e\n\n`netpbm.ImgColor.from_json(file_or_json: str=None)`\n\n**Description:** Reads everything from a JSON file or string.\nReads the full contents for the actual Image instance from a local JSON file full path string of `*.json` file extension or JSON string itself.\nFile extension must be provided. File extension will Not be added automatically.\nIf `file_or_json` is a string with the JSON then it will be used directly as Image data.\nThis deserializes data from JSON.\n\n**Arguments:**\n- `file_or_json` local file path string of `*.json` file or JSON string.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.from_json(\"my_json_file.json\")\n```\n\u003c/details\u003e\n\n\n\n##### set_random_bitmap\n\u003cdetails\u003e\n\n`netpbm.ImgColor.set_random_bitmap()`\n\n**Description:** Makes a Random bitmap image.\nFills up all pixels of the Image with Random pixels.\n\n**Arguments:** None.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.set_random_bitmap()\n```\n\u003c/details\u003e\n\n\n\n##### invert_colors\n\u003cdetails\u003e\n\n`netpbm.ImgColor.invert_colors()`\n\n**Description:** Inverts the image colors.\nInverts all pixels of the Image with the opposite color of pixels.\n\n**Arguments:** None.\n\n**Keyword Arguments:** None.\n\n**Returns:** None.\n\n**Source Code file:** https://github.com/juancarlospaco/anglerfish/blob/master/anglerfish/netpbm.py\n\n| State              | OS          | Description |\n| ------------------ |:-----------:| -----------:|\n| :white_check_mark: | **Linux**   | Works Ok    |\n| :white_check_mark: | **Os X**    | Works Ok    |\n| :white_check_mark: | **Windows** | Works Ok    |\n\n**Usage Example:**\n\n```python\n\u003e\u003e\u003e from netpbm import ImgColor\n\u003e\u003e\u003e image= ImgColor(10, 10)\n\u003e\u003e\u003e image.invert_colors()\n```\n\u003c/details\u003e\n\n- The Class has `__enter__()`, `__exit__()` and `__str__()` magic methods. Has `with` context manager and chaining support.\n\n\n# Requisites:\n\n- [Python 3.6+](https://www.python.org \"Python Homepage\")\n\n\n# Coding Style Guide:\n\n- Lint, [PEP-8](https://www.python.org/dev/peps/pep-0008), [PEP-257](https://www.python.org/dev/peps/pep-0257), [PyLama](https://github.com/klen/pylama#-pylama), [iSort](https://github.com/timothycrosley/isort) must Pass Ok. `pip install --upgrade pep8 pep257 pylama isort pytest`\n\n\n# Why?\n\nI cant find anything simple on pure Python without dependencies to make an image with a simple matrix of integers:\n- https://github.com/search?l=Python\u0026q=netpbm\u0026type=Repositories\u0026utf8=%E2%9C%93\n- https://pypi.python.org/pypi?%3Aaction=search\u0026term=netpbm\u0026submit=search\n- Because I can.\n\n\n# Licence:\n\n- GNU GPL Latest Version *AND* GNU LGPL Latest Version *AND* any Licence YOU Request via Bug Report.\n\n\n# Ethics and Humanism Policy:\n\n- Politics and Religions is not allowed.\n- This project has Feminism Ally conduct.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuancarlospaco%2Fnetpbm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuancarlospaco%2Fnetpbm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuancarlospaco%2Fnetpbm/lists"}