{"id":15008079,"url":"https://github.com/9551-dev/luaqoi","last_synced_at":"2026-02-12T07:05:44.700Z","repository":{"id":256660872,"uuid":"855601795","full_name":"9551-Dev/luaqoi","owner":"9551-Dev","description":"QOI (Quite Okay Image) decoding and encoding library written in Lua","archived":false,"fork":false,"pushed_at":"2024-09-15T19:13:40.000Z","size":34132,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-23T10:48:42.782Z","etag":null,"topics":["cc-tweaked","cctweaked","computercraft","decoder","encoder","graphics","graphics-programming","lua","qoi","qoi-format"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/9551-Dev.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":"2024-09-11T06:27:04.000Z","updated_at":"2024-09-26T09:02:48.000Z","dependencies_parsed_at":"2024-09-15T20:26:41.141Z","dependency_job_id":null,"html_url":"https://github.com/9551-Dev/luaqoi","commit_stats":null,"previous_names":["9551-dev/luaqoi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/9551-Dev/luaqoi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9551-Dev%2Fluaqoi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9551-Dev%2Fluaqoi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9551-Dev%2Fluaqoi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9551-Dev%2Fluaqoi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9551-Dev","download_url":"https://codeload.github.com/9551-Dev/luaqoi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9551-Dev%2Fluaqoi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274130142,"owners_count":25227270,"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-09-08T02:00:09.813Z","response_time":121,"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":["cc-tweaked","cctweaked","computercraft","decoder","encoder","graphics","graphics-programming","lua","qoi","qoi-format"],"created_at":"2024-09-24T19:15:00.947Z","updated_at":"2026-02-12T07:05:44.674Z","avatar_url":"https://github.com/9551-Dev.png","language":"Lua","readme":"# LuaQOI\n\nLua libary for decoding an encoding [.qoi](https://qoiformat.org) images on a similar level to FFMPEG/GIMP/IM.\n\n#### Decoder arguments:\n`qoid.decode(data_source,[no_alpha])` -\u003e `[table]`\n- data_source`[table]` list in some way representing data given to the decoder, can have 3 entries\n    - `data`: raw binary string of image data\n    - `file`: path to an image file\n    - `handle`: binary file handle (QOI_D closes this handle)\n- no_alpha`[boolean]`: if an image has an alpha channel, this strips it (useful for easier handling of hexadecimal output data), defaults to `false`\n#### Decoder result `[table]`\n- width`[u32]`: Width of the decoded image\n- height`[u32]`: Height of the decoded image\n- pixels`[table]`: 2D array[y][x] storing all the pixel colors encoded as hex\n- channels`[string]`: Either `\"RGB\"` or `\"RGBA\"`\n- colorspace`[string]`: Either `\"SRGB_LINEAR_ALPHA\"` or `\"SRGB_LINEAR\"`\n\n---\n\n#### Encoder arguments:\n`qoie.encode(image_data,[width],[height],[alpha_channel],[output_file],[colorspace])` -\u003e `[string]`\n- image_data`[table]`: 2D array[y][x] containing all the pixels we want to encode into the QOI (either as hex or 3/4 entry tables, 4 entries used for alpha/transparency)\n- width`[u32]`: Desired width of the encoded image, defaults to the length of the first image row (`#image_data[1]`)\n- height`[u32]`: Desired height of the encoded image, defualts to the row count of image_data (`#image_data`)\n- alpha_channel`[boolean]`: Enables alpha channel encoding on the image, hex format: `0xRRGGBBAA`, defaults to `false`\n- output_file`[string]`: Automatically saves the resulting binary string to a file given a path, defaults to no file saving.\n- colorspace`[string]`: QOI image colorspace, defaults to SRGB_LINEAR_ALPHA.\n\n#### Encoder result `[string]`\n- A binary string containing all of the image data, can be saved to a file via binary file handle.\n\n### Example [decoder](./qoi_d.lua) usage:\n```lua\nlocal img_src = select(1,...)\nlocal pixel_x = tonumber(select(2,...))\nlocal pixel_y = tonumber(select(3,...))\n\nlocal qoid = require(\"qoi_d\")\n\nlocal decoded = qoid.decode({file=img_src})\n\nlocal color_hex = decoded.pixels[pixel_y][pixel_x]\n\nprint((\"Pixel at %s:%s is #%x\"):format(\n    pixel_x,pixel_y,\n    color_hex\n))\n```\n\n### Example [encoder](./qoi_e.lua) usage\n```lua\nlocal qoie = require(\"qoi_e\")\n\nlocal data = {\n    {0xFF0000,0x0000FF},\n    {0x00FFFF,0xFFFF00}\n}\n\nlocal dat = qoie.encode(data)\n```\nor something like this\n```lua\nlocal qoie = require(\"qoi_e\")\n\nlocal data = {\n    {0xFF0000,0x0000FF},\n    {0x00FFFF,0xFFFF00},\n    {0x0000FF,0xFF0000}\n}\n\nqoie.encode(data,2,3,false,\"epic_output.ppm\")\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9551-dev%2Fluaqoi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9551-dev%2Fluaqoi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9551-dev%2Fluaqoi/lists"}