{"id":26600847,"url":"https://github.com/mrhdias/nim-libgd","last_synced_at":"2025-06-17T11:09:24.652Z","repository":{"id":67933480,"uuid":"175900022","full_name":"mrhdias/nim-libgd","owner":"mrhdias","description":"Nim Wrapper for LibGD 2.x","archived":false,"fork":false,"pushed_at":"2021-03-18T17:52:09.000Z","size":493,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T16:44:23.232Z","etag":null,"topics":["gd","image-processing","nim-lang","nim-language"],"latest_commit_sha":null,"homepage":null,"language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrhdias.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-15T22:39:03.000Z","updated_at":"2024-09-26T01:07:58.000Z","dependencies_parsed_at":"2023-07-15T22:48:11.010Z","dependency_job_id":null,"html_url":"https://github.com/mrhdias/nim-libgd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrhdias/nim-libgd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrhdias%2Fnim-libgd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrhdias%2Fnim-libgd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrhdias%2Fnim-libgd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrhdias%2Fnim-libgd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrhdias","download_url":"https://codeload.github.com/mrhdias/nim-libgd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrhdias%2Fnim-libgd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260346875,"owners_count":22995151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gd","image-processing","nim-lang","nim-language"],"created_at":"2025-03-23T18:35:40.730Z","updated_at":"2025-06-17T11:09:19.632Z","avatar_url":"https://github.com/mrhdias.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nim-libgd\nNim Wrapper for [LibGD](https://libgd.github.io/) 2.x\n\nWork in progress...\n\nThis library has been tested with Nim v1.4.4 [Linux: amd64]\n\n## Example of Usage\n\n```nim\nimport libgd\n\nproc main() =\n\n  withGd imageCreate(300, 300) as img:\n    discard img.backgroundColor(0xffffff)\n    let green = img.setColor(0, 0, 255)\n\n    img.setThickness(4)\n    img.drawRectangle(\n      startCorner=[10, 10],\n      endCorner=[300 - 10, 300 - 10],\n      color=green)\n    let png_out = open(\"test.png\", fmWrite)\n    img.writePng(png_out)\n    png_out.close()\n\nmain()\n```\n### Fractal Image from Examples\n\n![Newton Fractal](examples/outputs/newton_fractal.png)\n\n### Graph from Examples\n\n![Cubic Function Graph](examples/outputs/cubic_function_graph.png)\n\n## How to install nim-libgd with Nimble?\n\nYou need to have installed the [gd](https://libgd.github.io/) library in your system.\n\nIf you use Arch Linux, the library can be installed with: sudo pacman -S gd.\n\nRun the [Nimble](https://github.com/nim-lang/nimble) install command: $ nimble install https://github.com/mrhdias/nim-libgd\n\n## Functions\n\nWork in progress...\n\n### Drawing Functions\n\n```nim\nproc setPixel(\n  img: gdImagePtr,\n  point: array[2,int],\n  color: int = -1\n)\nproc drawLine(\n  img: gdImagePtr,\n  start_point: array[2,int],\n  end_point: array[2,int],\n  color: int = -1,\n  dashed: bool = false\n)\nproc drawRectangle(\n  img: gdImagePtr,\n  start_corner: array[2,int],\n  end_corner: array[2,int],\n  color: int,\n  fill: bool = false\n)\nproc drawArc(\n  img: gdImagePtr,\n  center: array[2,int],\n  axis: array[2,int],\n  angles: array[2,int],\n  color: int,\n  fill: bool = false,\n  style: int = 0\n)\nproc drawEllipse(\n  img: gdImagePtr,\n  center: array[2,int],\n  axis: array[2,int],\n  color: int,\n  fill: bool = false\n)\nproc drawCircle(\n  img: gdImagePtr,\n  center: array[2,int],\n  radius: int,\n  color: int = -1,\n  fill: bool = false\n)\nproc drawPolygon(\n  img: gdImagePtr,\n  points: openArray[array[0..1, int]],\n  color: int,\n  fill: bool = false,\n  open: bool = false\n)\nproc drawRegularPolygon(\n  img: gdImagePtr,\n  center: array[2,int],\n  sides: int,\n  radius: int,\n  start_angle: int = 0,\n  color: int,\n  fill: bool = false,\n  open: bool = false\n)\n```\n### Image Filters\n\n```nim\nproc filterContrast(src: gdImagePtr, contrast: float): bool\nproc filterBrightness(src: gdImagePtr, brightness: int): bool\nproc filterGrayScale(src: gdImagePtr): bool\nproc filterNegate(src: gdImagePtr): bool\nproc filterEmboss(src: gdImagePtr): bool\nproc filterGaussianBlur(src: gdImagePtr): bool\nproc filterSmooth(src: gdImagePtr, weight: float): bool\nproc filterEdgeDetectQuick(src: gdImagePtr): bool\nproc filterSelectiveBlur(src: gdImagePtr): bool\nproc filterMeanRemoval(src: gdImagePtr): bool\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrhdias%2Fnim-libgd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrhdias%2Fnim-libgd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrhdias%2Fnim-libgd/lists"}