{"id":21543838,"url":"https://github.com/thealexdev23/libpel","last_synced_at":"2025-03-17T23:56:02.407Z","repository":{"id":172206351,"uuid":"648545513","full_name":"TheAlexDev23/libpel","owner":"TheAlexDev23","description":"C Photo Editing Library","archived":false,"fork":false,"pushed_at":"2023-07-30T11:35:20.000Z","size":147,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T08:44:03.089Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheAlexDev23.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":"2023-06-02T08:11:27.000Z","updated_at":"2023-08-07T20:14:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"b692e3a9-ac5c-4317-943f-f711786c42cc","html_url":"https://github.com/TheAlexDev23/libpel","commit_stats":null,"previous_names":["thealexdev23/libpel"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlexDev23%2Flibpel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlexDev23%2Flibpel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlexDev23%2Flibpel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlexDev23%2Flibpel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheAlexDev23","download_url":"https://codeload.github.com/TheAlexDev23/libpel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130278,"owners_count":20402753,"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":[],"created_at":"2024-11-24T05:15:50.100Z","updated_at":"2025-03-17T23:56:02.399Z","avatar_url":"https://github.com/TheAlexDev23.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PEL: Photo Editing Library\n\nC library that allows image manipulation and image editing. Originally written for a school project.\n\nCurrent supported filetypes include:\n- PNG\n- JPEG\n- WEBP\n\n## Installation\n\n`install.sh` adds the pkgconf file of libpel to the system, configures the project and builts it.\nAfter building, copies header and binaries into /usr/include/pel and /usr/bin.\nRequires to be run with root privilegies.\n\n```bash\ngit clone https://github.com/TheAlexDev23/libpel\ncd libpel\nchmod +x ./install.sh\nsudo ./install.sh\n```\n\n## Using library\nIf running the default install script, a pkgconf file should have been created. You can build your project and add this library by adding the output of `pkgconf pel --libs -cflags` to the compile options of your project.\n\nExample\n```bash\ncc mycode.c `pkgconf pel --libs -cflas` -o mybin\n```\n\n## Basic API overview\nPEL has an internal handle referencing all the needed data about the current image. The user only needs to call the initialazation function.\n\n```C\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n\n#include \u003cpel.h\u003e\n\nint err()\n{\n    fprintf(stderr, \"ERROR: %s\\n\", pel_strerrno());\n    return -1;\n}\n\nint main()\n{\n    system(\"mkdir circles\");\n\n    if (pel_set_src_dest(\"circles/circle.png\", \"circles/circle.png\"))\n        return err();\n    \n    if (pel_init(100, 100))\n        return err();\n\n    if (pel_draw_circle(PEL_COLOR_WHITE, PEL_CORD(10, 10), 15))\n        return err();\n\n    if (pel_save())\n        return err();\n\n    if (pel_set_src_dest(\"circles/circle-full.png\", \"circles/circle-full.png\"))\n        return err();\n\n    if (pel_init(100, 100))\n        return err();\n\n    if (pel_draw_circle_full(PEL_COLOR_WHITE, PEL_CORD(-10, 10), 15))\n        return err();\n\n    if (pel_save())\n        return err();\n\n    return 0;\n}\n```\n\nThe [tests folder](/tests/) has a series of tests used in development to test the functionality of the library. They are good examples of the functionaity and API of PEL.\n\n## Documentation\nComming soon. I'm currrently only focusing on just the development but I'll probably add API and internal (structure relaated, useful for development) documentation after I finish the base functionality. But as a general overview, the API has these functions:\n\n### Functions\n\n**Init Exit**\n- pel_set_src_dest\n- pel_init\n- pel_save\n\n**Shapes**\n\n- pel_draw_circle\n- pel_draw_circle_full\n- pel_draw_rectangle\n- pel_draw_rectangle_full\n- pel_draw_line\n- pel_draw_textbox\n- pel_draw_triangle\n- pel_draw_triangle_full\n\n**Error handling**\n\nEach PEL function returns -1 on error. Error codes and errors can be accessed with:\n- pel_errno -\u003e current error code\n- pel_sterr -\u003e description of error\n- pel_strerrno -\u003e description of current error code\n\n**Structs, enums and macros**\n\n- pel_color_t -\u003e rgba color\n- PEL_COLOR_(BLACK/WHITE/RED/GREEN/BLUE) -\u003e macros facilitating the creatoin of pel_color_t\n- pel_bitmap_t\n- pel_cord_t -\u003e 2D coordinate\n- PEL_CORD -\u003e macro facilitating the creation of pel_cord_t\n- pel_font_t -\u003e represenatation of a font\n- PEL_FONT -\u003e macro facilitating the creation of fonts\n- pel_text_align_t -\u003e enum representing alignment of text\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealexdev23%2Flibpel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthealexdev23%2Flibpel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealexdev23%2Flibpel/lists"}