{"id":22439396,"url":"https://github.com/junka/ffpic","last_synced_at":"2025-10-07T22:44:54.235Z","repository":{"id":71421644,"uuid":"415054023","full_name":"junka/ffpic","owner":"junka","description":"image decode project for hands-on learning","archived":false,"fork":false,"pushed_at":"2024-08-09T08:12:43.000Z","size":1401,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T14:19:20.467Z","etag":null,"topics":["heif","hevc","images","jpeg","sdl2","webp"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-10-08T16:20:48.000Z","updated_at":"2024-07-17T07:52:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ef0e0d9-86e4-4c87-a88c-b1733d669910","html_url":"https://github.com/junka/ffpic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fffpic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fffpic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fffpic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junka%2Fffpic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junka","download_url":"https://codeload.github.com/junka/ffpic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245815708,"owners_count":20676959,"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":["heif","hevc","images","jpeg","sdl2","webp"],"created_at":"2024-12-06T01:14:01.908Z","updated_at":"2025-10-07T22:44:49.187Z","avatar_url":"https://github.com/junka.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"### For on-hands learning, with no third-party lib dependency\n\nFor all kind of images, we treat the data as two parts. ```format meta``` and ```raw coded data```.\nThe format meta typically is a file header or mixed with raw coded data in certain structure.\nThe raw coded data is usualy data that has been quantized, transformed, and entropy coded.\n\nThere is no secret in all the image compression tech. With knowledge about the above two parts, we can decode a image all by ourself.\n\nWe should learn the picture format following the order:\n```\nbmp -\u003e png -\u003e jpeg -\u003e webp -\u003e heif\n```\nSee the tutorial on [Wiki](https://github.com/junka/ffpic/wiki)\n\nIf you would like to know gif/pnm/tiff/tga, this could be learned before jpeg.\n\n#### File Format\nsupported file formart is:\n| Name  | Decoding |             Comments             |\n| :---: | :------: | :------------------------------: |\n|  GIF  |    y     |   Graphaic Interchange Format    |\n|  PNG  |    y     |    Portable Network Graphics     |\n|  BMP  |    y     |       Microsoft BMP image        |\n|  PBM  |    y     |      Portable BitMap image       |\n|  PGM  |    y     |      Portable GrayMap image      |\n|  PPM  |    y     |     Portable PixelMap image      |\n|  PAM  |    y     |     Portable Arbitrary image     |\n|  TGA  |    y     | Truevision raster graphic format |\n| TIFF  |    y     |      Tag Image File Format       |\n|  JPG  |    y     |         jpeg lossy image         |\n|  ICO  |    y     |        icon bitmap image         |\n|  EXR  |    y     |          OpenEXR image           |\n| WEBP  |    y     |         WEBP lossy image         |\n| HEIF  |    y     |         heif/hevc image          |\n\n[Format reference](http://www.martinreddy.net/gfx/2d-hi.html)\n\n### display rgb data\nTips on display:\nAfter decoding, usually we get rgb data from least significant byte, But for sdl display, the data need to be  ```BGRA``` from least significant byte. So, a reorder is need for display.\n\nOr we can use YUV data to display directly via sdl api.\n\n### Samples\n\ntake bmp, gif, etc samples from [filesamples](https://filesamples.com/categories/image)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunka%2Fffpic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunka%2Fffpic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunka%2Fffpic/lists"}