ad-si/FlatCV

Image processing and computer vision library in pure C

C

62

130 commits

updated Jun 17, 2026

See the code

README

FlatCV

Image processing and computer vision library in pure C.

Features

Flip, Crop, Trim, Resize, Blur, Draw, Grayscale, Binarize
Corner-Detection, QR-Code Decoding, Segmentation, Document-Extraction

Check out the official documentation for more details on each feature.

Cross Platform Support

  • Linux (x86 & arm64)
  • macOS (x86 & arm64)
  • Windows (x86 & arm64)
  • PowerPC
  • RISC-V

Usage

FlatCV can either be used as a C library or via its CLI.

You can get the single file version of the code and the CLI binaries in the release artifacts section of each release: github.com/ad-si/FlatCV/releases

CLI

The CLI supports edit pipelines which sequentially apply all transformations.

flatcv <input> <comma-separated-edit-pipeline> <output>

As commas aren't special characters in shells, you can write the edit pipeline without quotes. Both variants yield the same result:

flatcv i.jpg 'grayscale, blur 9' o.jpg
flatcv i.jpg grayscale, blur 9 o.jpg

Examples

Check out the official documentation website for more examples and usage instructions.

CommandInputOutput
flatcv i.jpg grayscale o.jpgParrotParrot Grayscale
flatcv i.jpg grayscale, blur 9 o.jpgParrotParrot Grayscale and Blur
flatcv i.jpg bw_smooth o.jpgParrotSmooth Binarization
flatcv i.jpg watershed 0x0 300x200 599x0 o.jpgParrotWatershed Segmentation

Library

#include "flatcv.h"

// Resize an image to 50%
unsigned char const * half_size = resize(
  input_width, input_height,
  0.5, 0.5,
  &out_width, &out_height,
  input_data
);

// Do something with the resized image

free(half_size);
c
cli
cli-tool
computer-vision
grayscale
image
image-filter
image-manipulation
image-pipeline
image-processing
magick
opencv
otsu
single-header
vips

Contributors

ad-si

128 commits

barracuda156

1 commits

claude

1 commits

ad-si/FlatCV

Image processing and computer vision library in pure C

C

62

130 commits

updated Jun 17, 2026

See the code

README

FlatCV

Image processing and computer vision library in pure C.

Features

Flip, Crop, Trim, Resize, Blur, Draw, Grayscale, Binarize
Corner-Detection, QR-Code Decoding, Segmentation, Document-Extraction

Check out the official documentation for more details on each feature.

Cross Platform Support

  • Linux (x86 & arm64)
  • macOS (x86 & arm64)
  • Windows (x86 & arm64)
  • PowerPC
  • RISC-V

Usage

FlatCV can either be used as a C library or via its CLI.

You can get the single file version of the code and the CLI binaries in the release artifacts section of each release: github.com/ad-si/FlatCV/releases

CLI

The CLI supports edit pipelines which sequentially apply all transformations.

flatcv <input> <comma-separated-edit-pipeline> <output>

As commas aren't special characters in shells, you can write the edit pipeline without quotes. Both variants yield the same result:

flatcv i.jpg 'grayscale, blur 9' o.jpg
flatcv i.jpg grayscale, blur 9 o.jpg

Examples

Check out the official documentation website for more examples and usage instructions.

CommandInputOutput
flatcv i.jpg grayscale o.jpgParrotParrot Grayscale
flatcv i.jpg grayscale, blur 9 o.jpgParrotParrot Grayscale and Blur
flatcv i.jpg bw_smooth o.jpgParrotSmooth Binarization
flatcv i.jpg watershed 0x0 300x200 599x0 o.jpgParrotWatershed Segmentation

Library

#include "flatcv.h"

// Resize an image to 50%
unsigned char const * half_size = resize(
  input_width, input_height,
  0.5, 0.5,
  &out_width, &out_height,
  input_data
);

// Do something with the resized image

free(half_size);
c
cli
cli-tool
computer-vision
grayscale
image
image-filter
image-manipulation
image-pipeline
image-processing
magick
opencv
otsu
single-header
vips

Contributors

ad-si

128 commits

barracuda156

1 commits

claude

1 commits

Languages

C

79.4%

JavaScript

7.0%

Python

6.5%

Haskell

5.3%