Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blagojeblagojevic/image.h
Low level image processing header only libary
https://github.com/blagojeblagojevic/image.h
c header-only image-processing stb stb-image
Last synced: 12 days ago
JSON representation
Low level image processing header only libary
- Host: GitHub
- URL: https://github.com/blagojeblagojevic/image.h
- Owner: BlagojeBlagojevic
- License: mit
- Created: 2024-02-14T10:47:13.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-16T07:50:14.000Z (7 months ago)
- Last Synced: 2024-06-16T08:49:43.454Z (7 months ago)
- Topics: c, header-only, image-processing, stb, stb-image
- Language: C++
- Homepage:
- Size: 8.08 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
---
# Image Processing Library
This is a simple C library for basic image processing operations, including loading images, arithmetic operations, filtering, and manipulation.
## Table of Contents
- [Introduction](#introduction)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)## Introduction
This library provides a set of functions to work with images represented as matrices of pixel values. It offers functionalities to perform operations such as addition, subtraction, multiplication, division, convolution, black and white filtering, channel manipulation, and more.
## Features
- Load images from files
- Basic arithmetic operations on images
- Convolution with custom kernels
- Black and white filtering
- Channel manipulation
- Drawing rectangles on images## Installation
To use this library, simply include the `image.h` header file in your C project, along with the `stb_image.h` and `stb_image_write.h` libraries, which are included by default.
```c
#include "image.h"
```## Usage
The library provides a set of functions that operate on the `Image` struct defined in `image.h`. Before using any functions, make sure to allocate memory for the `Image` struct using the provided functions.
```c
Image myImage = Image_Alloc(100, 100, 3); // Allocate a 100x100 RGB image
```Once an image is allocated, you can perform various operations on it, such as saving the image, applying filters, manipulating channels, and more.
## Examples
Here's an example of loading an image, applying a filter, and saving the result:
```c
#include
#define IMAGE_IMPLEMENTATION
#include "image.h"int main() {
// Load an image from file
Image inputImage = Image_Alloc_Name("input.jpg");// Apply a custom kernel for convolution
float customKernel[] = {0, 0, 0, 0, 1, 0, 0, 0, 0};
Image filteredImage = Image_Apply_Kernel(inputImage, customKernel, 3, 3);// Save the filtered image
Image_Save(filteredImage, "output.jpg");// Free allocated memory
Image_Free(inputImage);
Image_Free(filteredImage);return 0;
}
```## Contributing
Contributions are welcome! If you have any ideas for improvements or new features, feel free to open an issue or submit a pull request.
## License
This library is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
---
Feel free to adjust the content according to your preferences or add more sections as needed.