{"id":21383717,"url":"https://github.com/stumpycr/stumpy_core","last_synced_at":"2025-07-13T14:31:29.717Z","repository":{"id":47498314,"uuid":"68649330","full_name":"stumpycr/stumpy_core","owner":"stumpycr","description":"Core components for working with images ","archived":false,"fork":false,"pushed_at":"2023-12-04T18:24:45.000Z","size":234,"stargazers_count":32,"open_issues_count":3,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T12:11:54.097Z","etag":null,"topics":["computer-graphics","crystal","image-processing"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/stumpycr.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":"2016-09-19T21:44:39.000Z","updated_at":"2024-07-30T14:42:42.000Z","dependencies_parsed_at":"2024-11-22T13:15:20.774Z","dependency_job_id":null,"html_url":"https://github.com/stumpycr/stumpy_core","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/stumpycr/stumpy_core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpycr%2Fstumpy_core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpycr%2Fstumpy_core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpycr%2Fstumpy_core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpycr%2Fstumpy_core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stumpycr","download_url":"https://codeload.github.com/stumpycr/stumpy_core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpycr%2Fstumpy_core/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265155688,"owners_count":23719566,"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":["computer-graphics","crystal","image-processing"],"created_at":"2024-11-22T11:32:06.028Z","updated_at":"2025-07-13T14:31:29.229Z","avatar_url":"https://github.com/stumpycr.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stumpy_core\n\n[Documentation](https://docs.leonrische.me/stumpy_core/)\n\n## Usage\n\nThis library is not very useful on its own\nbut there are a few other libraries\nthat allow creating a canvas from an image file\nor saving one to an image file.\n\n* \u003chttps://github.com/stumpycr/stumpy_png\u003e\n* \u003chttps://github.com/stumpycr/stumpy_gif\u003e\n\n```crystal\nrequire \"stumpy_core\"\n\ninclude StumpyCore\n\nrainbow = Canvas.new(256, 256)\n(0...255).each do |x|\n  (0...255).each do |y|\n    # RGBA.from_rgb_n(values, bit_depth) is an internal helper method\n    # that creates an RGBA object from a rgb triplet with a given bit depth\n    color = RGBA.from_rgb_n(x, y, 255, 8)\n    rainbow[x, y] = color\n  end\nend\n\n# It is also possible to provide a background color,\n# the default is transparent black `RGBA.new(0, 0, 0, 0)`\nwhite = Canvas.new(256, 256, RGBA.from_hex(\"#ffffff\"))\n\n# If the colors for all pixels are already known when creating the canvas,\n# the block syntax can be used to simplify the code:\n\nrainbow2 = Canvas.new(256, 256) { |x, y| RGBA.from_rgb_n(x, y, 255, 8) }\n\ncheckerboard = Canvas.new(256, 256) do |x, y|\n  if ((x / 32) + (y / 32)).odd?\n    RGBA.from_hex(\"#ffffff\")\n  else\n    RGBA.from_hex(\"#000000\")\n  end\nend\n\nspectrum  = Canvas.new(361, 101) { |x, y| RGBA.from_hsl(x, 100, y) }\nspectrum2 = Canvas.new(361, 101) { |x, y| RGBA.from_hsba([x, 100, y], 1) }\n```\n\n![rainbow image](images/rainbow.png)\n![checkerboard image](images/checkerboard.png)\n![spectrum image](images/spectrum.png)\n![spectrum2 image](images/hsv-spectrum.png)\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars.githubusercontent.com/u/2060269?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLeon\u003c/b\u003e\u003c/sub\u003e](https://github.com/l3kn)\u003cbr /\u003e[💻](https://github.com/l3kn/stumpy_core/commits?author=l3kn \"Code\") | [\u003cimg src=\"https://avatars.githubusercontent.com/u/1298501?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eIan Rash\u003c/b\u003e\u003c/sub\u003e](http://broken-kami.tumblr.com)\u003cbr /\u003e[💻](https://github.com/l3kn/stumpy_core/commits?author=redcodefinal \"Code\") | [\u003cimg src=\"https://avatars2.githubusercontent.com/u/26842759?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSam\u003c/b\u003e\u003c/sub\u003e](https://github.com/Demonstrandum)\u003cbr /\u003e[💻](https://github.com/l3kn/stumpy_core/commits?author=Demonstrandum \"Code\") | [\u003cimg src=\"https://avatars0.githubusercontent.com/u/11876110?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ereiswindy\u003c/b\u003e\u003c/sub\u003e](https://github.com/reiswindy)\u003cbr /\u003e[📖](https://github.com/l3kn/stumpy_core/commits?author=reiswindy \"Documentation\") |\n| :---: | :---: | :---: | :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstumpycr%2Fstumpy_core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstumpycr%2Fstumpy_core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstumpycr%2Fstumpy_core/lists"}