{"id":22369888,"url":"https://github.com/zeozeozeo/kiten","last_synced_at":"2025-07-29T22:13:25.352Z","repository":{"id":62360114,"uuid":"559523831","full_name":"zeozeozeo/kiten","owner":"zeozeozeo","description":"Simple and fast 2D graphics library for Go","archived":false,"fork":false,"pushed_at":"2022-10-31T18:02:05.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T16:25:29.118Z","etag":null,"topics":["canvas","draw","fast","go","golang","graphics","library","realtime"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/zeozeozeo/kiten","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeozeozeo.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":"2022-10-30T11:43:28.000Z","updated_at":"2025-02-19T23:56:00.000Z","dependencies_parsed_at":"2022-10-31T13:02:53.347Z","dependency_job_id":null,"html_url":"https://github.com/zeozeozeo/kiten","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zeozeozeo/kiten","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fkiten","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fkiten/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fkiten/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fkiten/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeozeozeo","download_url":"https://codeload.github.com/zeozeozeo/kiten/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fkiten/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267771543,"owners_count":24142076,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["canvas","draw","fast","go","golang","graphics","library","realtime"],"created_at":"2024-12-04T19:29:36.291Z","updated_at":"2025-07-29T22:13:25.308Z","avatar_url":"https://github.com/zeozeozeo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kiten\n\nSimple and fast 2D graphics library for Go.\n\n# Examples\n\n## Create a new canvas\n\n```go\nwidth := 1280\nheight := 720\ncanvas := kiten.NewCanvas(width, height, kiten.BlendAdd)\n```\n\n## Create a new canvas from an RGBA image\n\n(you can use this later to overlay or draw on images, for example)\n\n```go\ncanvas := kiten.CanvasFromImageRGBA(image, kiten.BlendAdd)\n```\n\n## [Real time example](https://github.com/zeozeozeo/kiten-simple)\n\n![example](https://github.com/zeozeozeo/kiten-simple/blob/main/example.gif?raw=true)\n\n## Fill the whole canvas with a black color\n\nIf you're rendering multiple frames, remember to clear the canvas when drawing a new frame\n\n```go\ncanvas.Fill(color.RGBA{0, 0, 0, 255})\n```\n\n## Draw a red line from 100,100 to 500,700\n\n```go\ncanvas.Line(100, 100, 500, 700, color.RGBA{255, 0, 0, 255})\n```\n\n## Draw a blue circle at 150,150 with the radius of 70\n\n```go\ncanvas.Circle(150, 150, 70, color.RGBA{0, 0, 255, 255})\n```\n\n## Draw a filled blue circle at 150,150 with the radius of 70\n\n```go\ncanvas.CircleFilled(150, 150, 70, color.RGBA{0, 0, 255, 255})\n```\n\n## Draw a filled blue circle with a green outline at 150,150 with the radius of 70\n\n```go\ncanvas.CircleOutline(150, 150, 70, color.RGBA{0, 0, 255, 255}, color.RGBA{0, 255, 0, 255})\n```\n\n## Set the pixel at 500,500 to white\n\nThis will do nothing if the coordinates are invalid\n\n```go\ncanvas.SetPixel(500, 500, color.RGBA{255, 255, 255, 255})\n```\n\n## Get the pixel value at 170,300\n\nThis will return a transparent color if the coordinates are invalid\n\n```go\ncanvas.PixelAt(170, 300) // Returns color.RGBA\n```\n\n## Draw a green rectangle from 100,100 to 200,200 (not filled)\n\n```go\ncanvas.Rect(100, 100, 200, 200, color.RGBA{0, 255, 0, 255})\n```\n\n## Draw a green rectangle from 100,100 to 200,200 (filled)\n\n```go\ncanvas.RectFilled(100, 100, 200, 200, color.RGBA{0, 255, 0, 255})\n```\n\n## Draw a canvas on top of another canvas at 450,300 and resize it to 100 by 150 pixels\n\n```go\ncanvas.PutCanvas(450, 300, 100, 150, canvas2)\n```\n\n## Connect a path with white lines\n\n```go\nimport (\n    \"rand\"\n    \"image\"\n)\n\n// Generate a path\npath := []image.Point{}\nfor i := 0; i \u003c 100; i++ {\n    path = append(path, image.Pt(i*30, canvas.Height/2-rand.Intn(100)))\n}\n\n// Draw it\ncanvas.DrawPath(path, color.RGBA{255, 255, 255, 255})\n```\n\n## Draw text at 500,500\n\n```go\nimport \"golang.org/x/image/font/inconsolata\"\ncanvas.Text(\"Hello World!\", 500, 500, inconsolata.Regular8x16, color.RGBA{255, 255, 255, 255})\n```\n\n## Export canvas to PNG\n\n```go\nimport \"os\"\nfile, err := os.Create(\"output.png\")\nif err != nil {\n    panic(err)\n}\ndefer file.Close()\n\nerr := canvas.WritePNG(file)\nif err != nil {\n    panic(err)\n}\n```\n\n## Draw a white (not filled) triangle (500,500 -\u003e 500,700 -\u003e 600,700)\n\n```go\ncanvas.Triangle(500, 500, 500, 700, 600, 700, color.RGBA{255, 255, 255, 255})\n```\n\n## Draw a white filled triangle (500,500 -\u003e 500,700 -\u003e 600,700)\n\n```go\ncanvas.TriangleFilled(500, 500, 500, 700, 600, 700, color.RGBA{255, 255, 255, 255})\n```\n\n## Draw a white filled triangle with a red outline (500,500 -\u003e 500,700 -\u003e 600,700)\n\n```go\ncanvas.TriangleOutline(500, 500, 500, 700, 600, 700, color.RGBA{255, 255, 255, 255}, color.RGBA{255, 0, 0, 255})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeozeozeo%2Fkiten","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeozeozeo%2Fkiten","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeozeozeo%2Fkiten/lists"}