{"id":15634931,"url":"https://github.com/djdeveloperr/skia_canvas","last_synced_at":"2025-07-04T01:35:19.614Z","repository":{"id":61122828,"uuid":"538379797","full_name":"DjDeveloperr/skia_canvas","owner":"DjDeveloperr","description":"Fast HTML Canvas API implementation for Deno using Google Skia","archived":false,"fork":false,"pushed_at":"2024-10-11T01:14:52.000Z","size":1008,"stargazers_count":142,"open_issues_count":15,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T21:36:10.820Z","etag":null,"topics":["canvas","cpp","deno","fastest","ffi","hacktoberfest","skia","typescript"],"latest_commit_sha":null,"homepage":"https://jsr.io/@gfx/canvas","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DjDeveloperr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["djdeveloperr"]}},"created_at":"2022-09-19T07:19:45.000Z","updated_at":"2025-04-30T15:27:32.000Z","dependencies_parsed_at":"2024-10-23T03:23:41.581Z","dependency_job_id":null,"html_url":"https://github.com/DjDeveloperr/skia_canvas","commit_stats":{"total_commits":99,"total_committers":7,"mean_commits":"14.142857142857142","dds":0.06060606060606055,"last_synced_commit":"e700595380b545c5af5ca59573b77756ae1f60de"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/DjDeveloperr/skia_canvas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fskia_canvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fskia_canvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fskia_canvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fskia_canvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DjDeveloperr","download_url":"https://codeload.github.com/DjDeveloperr/skia_canvas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fskia_canvas/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263431515,"owners_count":23465533,"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":["canvas","cpp","deno","fastest","ffi","hacktoberfest","skia","typescript"],"created_at":"2024-10-03T10:59:12.953Z","updated_at":"2025-07-04T01:35:19.590Z","avatar_url":"https://github.com/DjDeveloperr.png","language":"C++","readme":"# Skia Canvas\n\n[![Tags](https://img.shields.io/github/release/DjDeveloperr/skia_canvas)](https://github.com/DjDeveloperr/skia_canvas/releases)\n[![Doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/skia_canvas@0.5.6/mod.ts)\n[![Checks](https://github.com/DjDeveloperr/skia_canvas/actions/workflows/ci.yml/badge.svg)](https://github.com/DjDeveloperr/skia_canvas/actions/workflows/ci.yml)\n[![License](https://img.shields.io/github/license/DjDeveloperr/skia_canvas)](https://github.com/DjDeveloperr/skia_canvas/blob/master/LICENSE)\n[![Sponsor](https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86)](https://github.com/sponsors/DjDeveloperr)\n\nFast HTML Canvas API implementation for Deno using Skia.\n\n## Example\n\n```ts\nimport { createCanvas } from \"jsr:@gfx/canvas@0.5.6\";\n\nconst canvas = createCanvas(300, 300);\nconst ctx = canvas.getContext(\"2d\");\n\n// Set line width\nctx.lineWidth = 10;\n\n// Wall\nctx.strokeRect(75, 140, 150, 110);\n\n// Door\nctx.fillRect(130, 190, 40, 60);\n\n// Roof\nctx.beginPath();\nctx.moveTo(50, 140);\nctx.lineTo(150, 60);\nctx.lineTo(250, 140);\nctx.closePath();\nctx.stroke();\n\ncanvas.save(\"image.png\");\n```\n\n## Usage\n\nSince this library depends on the unstable FFI API, you must pass `--allow-env`,\n`--allow-ffi` and `--unstable-ffi` flags. Without it, the module will fail to\nfind and open native library.\n\n```sh\ndeno run --allow-ffi --allow-env --unstable-ffi \u003cfile\u003e\n# or just\ndeno run -A --unstable-ffi \u003cfile\u003e\n```\n\n## API\n\nCheck the\n[API reference here](https://doc.deno.land/https/deno.land/x/skia_canvas@0.5.2/mod.ts).\n\nSince this module implements the Canvas Web API, you can also refer to the\n[MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D).\n\n### Non-standard APIs\n\nFor non-standard APIs, see to the API reference mentioned above.\n\n- `Canvas#save` - save canvas render as file\n- `Canvas#encode` - encode render into in-memory buffer\n- `Image` - provides utility to load image files for drawing on canvas\n- `Fonts` - provides utility to manage fonts used by Skia\n- `PdfDocument` - create PDF documents using 2D Canvas API\n- `SvgCanvas` - like `Canvas` but creates an SVG as output instead\n- Several additional methods in `Path2D` object such as `toSVGString`,\n  `simplify`, `difference`, `xor`, etc.\n\n## Benchmarks\n\n![Benchmark Results](./bench/results.png)\n\nSource: [bench/main.js](./bench/main.js)\n\n## Building\n\nFirst you need to\n[setup depot_tools](https://www.chromium.org/developers/how-tos/install-depot-tools/).\n\nThen, clone the repository with submodules.\n\nAnd run the following commands:\n\n```sh\ndeno task build-skia\ndeno task build\n```\n\nBy default, the module will download and cache the prebuilt binaries for your\nplatform. However this is not intended behavior when developing locally. To use\nlocally built binaries, set `DENO_SKIA_LOCAL` environment variable to `1`. Or\nyou can also set `DENO_SKIA_PATH` to a complete path to dynamic library built\nfrom the `native` directory.\n\n## License\n\n[Apache-2.0](./LICENSE) licensed.\n\nCopyright 2022-present © DjDeveloperr\n","funding_links":["https://github.com/sponsors/djdeveloperr","https://github.com/sponsors/DjDeveloperr"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjdeveloperr%2Fskia_canvas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjdeveloperr%2Fskia_canvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjdeveloperr%2Fskia_canvas/lists"}