{"id":13543134,"url":"https://github.com/srwiley/rasterx","last_synced_at":"2026-01-12T13:18:00.780Z","repository":{"id":33051291,"uuid":"130415797","full_name":"srwiley/rasterx","owner":"srwiley","description":"Rasterx is an SVG 2.0 path compliant rasterizer that can use either scany, the golang vector or a derivative of the freetype anti-aliaser.","archived":false,"fork":false,"pushed_at":"2022-07-30T22:56:03.000Z","size":455,"stargazers_count":139,"open_issues_count":8,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T12:39:04.753Z","etag":null,"topics":["2d-graphics","antialiasing","golang","raster"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srwiley.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":"2018-04-20T21:31:47.000Z","updated_at":"2025-03-16T14:36:03.000Z","dependencies_parsed_at":"2022-08-24T13:20:21.419Z","dependency_job_id":null,"html_url":"https://github.com/srwiley/rasterx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/srwiley/rasterx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwiley%2Frasterx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwiley%2Frasterx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwiley%2Frasterx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwiley%2Frasterx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srwiley","download_url":"https://codeload.github.com/srwiley/rasterx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srwiley%2Frasterx/sbom","scorecard":{"id":844337,"data":{"date":"2025-08-11","repo":{"name":"github.com/srwiley/rasterx","commit":"2ab79fcdd4ef8b552e5b4e4b43d24f74fc87aa61"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 2/24 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":"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":"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":"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":"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"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2023-1572 / GHSA-qgc7-mgm3-q253","Warn: Project is vulnerable to: GO-2023-1990 / GHSA-j3p8-6mrq-6g7h","Warn: Project is vulnerable to: GO-2023-1989 / GHSA-x92r-3vfx-4cv3","Warn: Project is vulnerable to: GO-2024-2937 / GHSA-9phm-fm57-rhg8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T21:06:33.877Z","repository_id":33051291,"created_at":"2025-08-23T21:06:33.877Z","updated_at":"2025-08-23T21:06:33.877Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["2d-graphics","antialiasing","golang","raster"],"created_at":"2024-08-01T11:00:23.816Z","updated_at":"2026-01-12T13:18:00.746Z","avatar_url":"https://github.com/srwiley.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# rasterx\n\nRasterx is a golang rasterizer that implements path stroking functions capable of SVG 2.0 compliant 'arc' joins and explicit loop closing. \n\n\n\n* Paths can be explicity closed or left open, resulting in a line join or end caps. \n* Arc joins are supported, which causes the extending edge from a Bezier curve to follow the radius of curvature at the end point rather than a straight line miter, resulting in a more fluid looking join. \n* Not specified in the SVG2.0 spec., but supported in rasterx is the arc-clip join, which is the arc join analog of a miter-clip join, both of which end the miter at a specified distance, rather than all or nothing.\n* Several cap and gap functions in addition to those specified by SVG2.0 are implemented, specifically quad and cubic caps and gaps.\n* Line start and end capping functions can be different.\n\n\n![rasterx example](/doc/TestShapes4.svg.png?raw=true \"Rasterx Example\")\n\nThe above image shows the effect of using different join modes for a stroked curving path. The top stroked path uses miter (green) or arc (red, yellow, orange) join functions with high miter limit. The middle and lower path shows the effect of using the miter-clip and arc-clip joins, repectively, with different miter-limit values. The black chevrons at the top show different cap and gap functions.\n\n## Scanner interface\n\nRasterx takes the path description of lines, bezier curves, and drawing parameters, and converts them into a set of straight line segments before rasterizing the lines to an image using some method of antialiasing. Rasterx abstracts this last step through the Scanner interface. There are two different structs that satisfy the Scanner interface; ScannerGV and [ScannerFT](https://github.com/srwiley/scanFT). ScannerGV wraps the rasterizer found in the golang.org/x/image/vector package. ScannerFT contains a modified version of the antialiaser found in the [golang freetype](https://github.com/golang/freetype) translation. These use different functions to connect an image to the antialiaser. ScannerFT uses a Painter to translate the raster onto the image, and ScannerGV uses the vector's Draw method with a source image and uses the path as an alpha mask. Please see the test files for examples. At this time, the ScannerFT is a bit faster as compared to ScannerGV for larger and less complicated images, while ScannerGV can be faster for smaller and more complex images. Also ScannerGV does not allow for using the even-odd winding rule, which is something the SVG specification uses. Since ScannerFT is subject to freetype style licensing rules, it lives [here](https://github.com/srwiley/scanFT) in a separate repository and must be imported into your project seperately. ScannerGV is included in the rasterx package, and has more go-friendly licensing. \n\nBelow are the results of some benchmarks performed on a sample shape (the letter Q ). The first test is the time it takes to scan the image after all the curves have been flattened. The second test is the time it takes to flatten, and scan a simple filled image. The last test is the time it takes to flatten a stroked and dashed outline of the shape and scan it. Results for three different image sizes are shown.\n\n\n```\n128x128 Image\nTest                        Rep       Time\nBenchmarkScanGV-16          5000      287180 ns/op\nBenchmarkFillGV-16          5000      339831 ns/op\nBenchmarkDashGV-16          2000      968265 ns/op\n\nBenchmarkScanFT-16    \t   20000       88118 ns/op\nBenchmarkFillFT-16    \t    5000      214370 ns/op\nBenchmarkDashFT-16    \t    1000     2063797 ns/op\n\n256x256 Image\nTest                        Rep       Time\nBenchmarkScanGV-16          2000     1188452 ns/op\nBenchmarkFillGV-16          1000     1277268 ns/op\nBenchmarkDashGV-16          500      2238169 ns/op\n\nBenchmarkScanFT-16    \t    5000      290685 ns/op\nBenchmarkFillFT-16    \t    3000      446329 ns/op\nBenchmarkDashFT-16    \t     500     2923512 ns/op\n\n512x512 Image\nTest                        Rep       Time\nBenchmarkScanGV-16           500     3341038 ns/op\nBenchmarkFillGV-16           500     4032213 ns/op\nBenchmarkDashGV-16           200     6003355 ns/op\n\nBenchmarkScanFT-16    \t    5000      292884 ns/op\nBenchmarkFillFT-16    \t    3000      449582 ns/op\nBenchmarkDashFT-16    \t     500     2800493 ns/op\n```\n\nThe package uses an interface called Rasterx, which is satisfied by three structs, Filler, Stroker and Dasher.  The Filler flattens Bezier curves into lines and uses an anonymously composed Scanner for the antialiasing step. The Stroker embeds a Filler and adds path stroking, and the Dasher embedds a Stroker and adds the ability to create dashed stroked curves.\n\n\n![rasterx Scheme](/doc/schematic.png?raw=true \"Rasterx Scheme\")\n\nEach of the Filler, Dasher, and Stroker can function on their own and each implement the Rasterx interface, so if you need just the curve filling but no stroking capability, you only need a Filler. On the other hand if you have created a Dasher and want to use it to Fill, you can just do this:\n\n```golang\nfiller := \u0026dasher.Filler\n```\nNow filler is a filling rasterizer. Please see rasterx_test.go for examples.\n\n\n### Non-standard library dependencies\nrasterx requires the following imports which are not included in the go standard library:\n\n* golang.org/x/image/math/fixed\n* golang.org/x/image/vector\n\nThese can be included in your gopath by the following 'get' commands:\n\n* \"go get golang.org/x/image/vector\"\n* \"go get golang.org/x/image/math/fixed\"\n\nIf you want to use the freetype style antialiaser, 'go get' or clone into your workspace the scanFT package:\n\n* github.com/srwiley/scanFT \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrwiley%2Frasterx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrwiley%2Frasterx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrwiley%2Frasterx/lists"}