{"id":13629113,"url":"https://github.com/symisc/ascii_art","last_synced_at":"2025-04-04T20:11:21.180Z","repository":{"id":43465278,"uuid":"109507216","full_name":"symisc/ascii_art","owner":"symisc","description":"Real-Time ASCII Art Rendering Library","archived":false,"fork":false,"pushed_at":"2022-09-24T16:23:15.000Z","size":212,"stargazers_count":722,"open_issues_count":0,"forks_count":84,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-03-28T19:08:13.487Z","etag":null,"topics":["algorithms","ascii-art","ascii-glyphs","embedded","graphics","image-processing","library","machine-learning","rendering","tree"],"latest_commit_sha":null,"homepage":"https://pixlab.io/art","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/symisc.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":"2017-11-04T15:37:41.000Z","updated_at":"2025-03-20T19:47:30.000Z","dependencies_parsed_at":"2022-09-25T14:51:41.565Z","dependency_job_id":null,"html_url":"https://github.com/symisc/ascii_art","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symisc%2Fascii_art","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symisc%2Fascii_art/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symisc%2Fascii_art/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symisc%2Fascii_art/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/symisc","download_url":"https://codeload.github.com/symisc/ascii_art/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"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":["algorithms","ascii-art","ascii-glyphs","embedded","graphics","image-processing","library","machine-learning","rendering","tree"],"created_at":"2024-08-01T22:01:02.740Z","updated_at":"2025-04-04T20:11:21.160Z","avatar_url":"https://github.com/symisc.png","language":"C","funding_links":[],"categories":["C","Libraries \u0026 SDKs"],"sub_categories":["C/C++/Rust"],"readme":"# ASCII Art\n### Real-Time ASCII Art Rendering Library - Live demo: https://art.pixlab.io\n### Integration Reference Guide: https://pixlab.io/art\n\nASCII Art is a single file C/C++ library that let you transform an input image or video frame into printable ASCII characters at real-time using a single decision tree. Real-time performance is achieved by using pixel intensity comparison inside internal nodes of the tree.\n\n### ASCII Camera Now Availabe On Unity Asset Store: https://assetstore.unity.com/packages/slug/165558\n\nFor a general overview on how the algorithm works, check the bottom of the [demo page](https://art.pixlab.io/#algo).\n\n![Output](https://i.imgur.com/cdJBzXI.png)\nASCII art is a related (and older) graphic design technique for producing images from printable characters. This implementation is based on the paper:\n\n\u003eN. Markus, M. Fratarcangeli, I. S. Pandzic and J. Ahlberg, \"Fast Rendering of Image Mosaics and ASCII Art\", Computer Graphics Forum, 2015, \u003chttp://dx.doi.org/10.1111/cgf.12597\u003e\n\n\n# Getting started\n\nEmbedding the library in your application is straightforward. All you have to do is drop the **ascii_art.c** and its header file in your source tree plus the hex model that can be downloaded [here](https://pixlab.io/art) and perform the following API calls successively:\n\n 1. Call [AsciiArtInit](https://pixlab.io/art) first to initialize the **ascii_render** structure defined in the **ascii_art.h** header file.\n 2. Prepare the image to be processed by converting it to the grayscale colorspace. You can rely on some external library like OpenCV [cvtColor](https://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html) or the built-in [AsciiArtLoadImage](https://pixlab.io/art) interface.\n 3. Allocate a buffer big enough to hold the entire ASCII text output. The amount of bytes needed is returned via the [AsciiArtTextBufSize](https://pixlab.io/art) interface. This step is optional if you do not want a text output but instead a binary ASCII glyphs image.\n 4. Finally, transform the input image into ASCII glyphs/text via [AsciiArtRender](https://pixlab.io/art).\n \nBelow is a simple C program that demonstrates a typical usage of the ASCII Art C/C++ interfaces.\n\n```C\n#include \"ascii_art.h\"\n\nascii_render sRender; /* Stack allocated */\n\t\n/* Initialize the render structure */\nAsciiArtInit(\u0026sRender);\n\t\n/* Load an image from disk */\nint width, height;\nunsigned char *zBlob = AsciiArtLoadImage(argv[1],\u0026width,\u0026height);\nif( zBlob == 0 ){\n\tputs(\"Cannot load image\");\n\treturn;\n}\n\t\n/* Allocate a buffer big enough to hold the entire text output */\nsize_t nBytes = AsciiArtTextBufSize(\u0026sRender, width, height);\nunsigned char *zText = malloc(nBytes);\n\t\n/* Finally, process */ \nAsciiArtRender(\u0026sRender, zBlob, \u0026width, \u0026height, zText,1);\n/* zBlob[] hold the binary ASCII glyphs now */\n\t\n/* Output the result */\nfwrite(zText, sizeof(char), nBytes, stdout);\n\t\n/* Release memory */\nfree(zText);\nfree(zBlob);\n```\nsample.c [source code](https://github.com/symisc/ascii_art/blob/master/sample.c)\n# Resources\n* The C/C++ API reference (Only three interfaces are exported plus another optional), the hex model are all available on the official PixLab page at: https://pixlab.io/art\n* The live demo: https://art.pixlab.io\n* Please report any issue or feature request here on Github. \n* Unity Asset Store Package: https://assetstore.unity.com/packages/slug/165558\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymisc%2Fascii_art","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsymisc%2Fascii_art","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymisc%2Fascii_art/lists"}