{"id":23968887,"url":"https://github.com/heshanera/iproc","last_synced_at":"2025-04-23T14:07:33.715Z","repository":{"id":76895675,"uuid":"103777940","full_name":"heshanera/IProc","owner":"heshanera","description":"A dynamic library for image processing. To Extract the pixel map of the image. Support PNG, JPG, TIF and BMP image file formats. Inbuilt methods for resizing, cropping, generating grayscale and binary images.","archived":false,"fork":false,"pushed_at":"2020-12-27T08:52:41.000Z","size":10402,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T00:22:51.860Z","etag":null,"topics":["bitmap","dynamic-library","image-processing","jpeg","libjpeg","libpng","libtiff","pixel-map","png","tif"],"latest_commit_sha":null,"homepage":"","language":"C++","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/heshanera.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}},"created_at":"2017-09-16T19:20:21.000Z","updated_at":"2024-10-29T15:57:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"621d4bfe-6433-40f6-9121-33a6fce30115","html_url":"https://github.com/heshanera/IProc","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/heshanera%2FIProc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heshanera%2FIProc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heshanera%2FIProc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heshanera%2FIProc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heshanera","download_url":"https://codeload.github.com/heshanera/IProc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250447999,"owners_count":21432164,"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":["bitmap","dynamic-library","image-processing","jpeg","libjpeg","libpng","libtiff","pixel-map","png","tif"],"created_at":"2025-01-07T00:55:27.754Z","updated_at":"2025-04-23T14:07:33.681Z","avatar_url":"https://github.com/heshanera.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IProc\n\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/mit-license.php) \u0026nbsp;\u0026nbsp;\n[![language](https://img.shields.io/badge/language-c%2B%2B-red.svg)](https://github.com/heshanera/IProc) \u0026nbsp;\u0026nbsp;\n[![library](https://img.shields.io/badge/library-libpng-brightgreen.svg)](http://www.libpng.org/pub/png/libpng.html) \u0026nbsp;\u0026nbsp;\n[![library](https://img.shields.io/badge/library-libjpeg-brightgreen.svg)](http://libjpeg.sourceforge.net/) \u0026nbsp;\u0026nbsp;\n[![library](https://img.shields.io/badge/library-libtiff-brightgreen.svg)](http://www.libtiff.org/) \u0026nbsp;\u0026nbsp;\n\nA dynamic library for image processing. To Extract the pixel map of the image. Support PNG, JPG, TIF and BMP image file formats. Inbuilt methods for resizing, cropping, generating grayscale and binary images.\n\n### Data Structures\n`RGBAPixel` \n`ImageDataStruct`\n```cpp\nstruct RGBApixel {\n    unsigned char r = 0;\n    unsigned char g = 0;\n    unsigned char b = 0;\n    unsigned char a = 0;\n};\n```\n```cpp\nstruct ImageDataStruct {\n    RGBApixel * imgPixArray;\n    int imgWidth;\n    int imgHeight;\n};\n```\n\n### Methods\n`int readImage(std::string);`\u003cbr\u003e\n`int writeImage(std::string);`\u003cbr\u003e\n`RGBApixel getPixel(int,int);`\u003cbr\u003e\n`ImageDataStruct getImageDataStruct();`\u003cbr\u003e\n`int setPixel(int,int,RGBApixel);`\u003cbr\u003e\n`int setImageDataStruct(ImageDataStruct);`\u003cbr\u003e\n`int resizeImage(int, int);`\u003cbr\u003e\n`int crop(int, int, int, int);`\u003cbr\u003e\n`int binary(int);`\u003cbr\u003e\n`int grayscale();`\u003cbr\u003e\n\n\n\n*reading the image file*\n```cpp\nIProc ip;\nip.readImage(\"path/to/source/file.jpg\");\n```\n*getting the pixel value*\n```cpp\n// pixel in the position (x, y)\nRGBApixel pix = ip.getPixel(10,10);\n```\n*set a pixel value*\n```cpp\n// set the pixel at position (x, y)\nRGBApixel pix;\npix.r = 100;\npix.g = 100;\npix.b = 100;\npix.a = 255;\nip.setPixel(10,15,pix);\n```\n*get the pixel map of the image*\n```cpp\nImageDataStruct imgData;\nimgData = ip.getImageDataStruct();\n// printing the height and width of the image\nstd::cout\u003c\u003c\"Image height: \"\u003c\u003cimgData.imgHeight;\nstd::cout\u003c\u003c\"Image width: \"\u003c\u003cimgData.imgWidth;\n```\n*resize the image*\n```cpp\n// resize the image (width, height)\nimgData.resizeImage(100,20);\n\n// resize the image (width, auto)\nimgData.resizeImage(100,-1);\n\n// resize the image (auto, height)\nimgData.resizeImage(-1,20);\n```\n*crop the image*\n```cpp\n// crop the image (row1, col1, row2, col2);\nimgData.crop(20,30,80,100);\n```\n*get the grayscale pixels of the image*\n```cpp\n// convert the RGB values to grayscale intensity values\nimgData.grayscale();\n```\n*get the binary pixel map of the image*\n```cpp\n// convert the image in to a binary image (grayscale intensity value)\nimgData.binary(125);\n```\n*write image to a target file*\n```cpp\n// write image to a given path\nimgData.writeImage(\"path/to/target/file.png\");\n```\n### Example\n```cpp\n#include \u003clibiproc.h\u003e\n#include \u003ciostream\u003e\n\nint main() {\n    \n    IProc ip;\n    ip.readImage(\"imgs/JPEG/input/img5.jpg\");\n    \n    int x = 10, y = 10;\n    RGBApixel pixel = ip.getPixel(x, y);\n    std::cout   \u003c\u003c\"Image(\"\u003c\u003cx\u003c\u003c\",\"\u003c\u003cy\u003c\u003c\") = \"\n                \u003c\u003c\"RGBA( \"\n                \u003c\u003c(int)pixel.r\u003c\u003c\" \"\n                \u003c\u003c(int)pixel.g\u003c\u003c\" \"\n                \u003c\u003c(int)pixel.b\u003c\u003c\" \"\n                \u003c\u003c(int)pixel.a\u003c\u003c\" \"\n                \u003c\u003c\")\\n\";\n    \n    ip.setPixel(10,15,pixel);\n    \n    ImageDataStruct img = ip.getImageDataStruct();\n    std::cout\u003c\u003c\"image height: \"\u003c\u003cimg.imgHeight;\n    std::cout\u003c\u003c\"\\n\";\n    std::cout\u003c\u003c\"image width: \"\u003c\u003cimg.imgWidth;\n    \n    ip.writeImage(\"imgs/PNG/output/img1.png\");\n    \n    ip.readImage(\"imgs/JPEG/input/img5.jpg\");\n    ip.grayscale();\n    ip.writeImage(\"imgs/PNG/output/img2.png\");\n    \n    ip.readImage(\"imgs/JPEG/input/img5.jpg\");\n    ip.binary(180);\n    ip.writeImage(\"imgs/PNG/output/img3.png\");\n    \n    ip.readImage(\"imgs/JPEG/input/img5.jpg\");\n    ip.resize(100,100);\n    ip.writeImage(\"imgs/PNG/output/img4.png\");\n    \n    return 0;\n}\n```\n#### Output\n```\n\u003e\u003e Image(10,10) = RGBA( 255 255 255 255 )\n\u003e\u003e image height: 250\n\u003e\u003e image width: 250\n```\n| **Original**  | **Grayscale**  | **Binary**  | **Resized**  | \n| ----- |-----|-----|-----|\n|![architecture](https://github.com/heshanera/IProc/blob/master/IProc%20Demo/imgs/JPEG/input/img5.jpg) |![architecture](https://github.com/heshanera/IProc/blob/master/IProc%20Demo/imgs/PNG/output/img2.png) |![architecture](https://github.com/heshanera/IProc/blob/master/IProc%20Demo/imgs/PNG/output/img3.png) |![architecture](https://github.com/heshanera/IProc/blob/master/IProc%20Demo/imgs/PNG/output/img4.png) |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheshanera%2Fiproc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheshanera%2Fiproc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheshanera%2Fiproc/lists"}