An image processing library implemented in pure-C
Ocular is a library for common and advanced image processing algorithms, without the use of any external dependencies. Suggestions for new features are welcome.
Note: RGBA byte-order is expected for all pixel data.
The documentation of the exported functions along with examples can be found at Library Documentation.
- Brightness/Contrast
- Exposure
- Gamma
- Levels
- Histogram Stretch (contrast stretching)
- Equalize
- Luminance Threshold (like Photoshop Threshold)
- Average Luminance Threshold
- Color Balance
- White Balance
- Color Temperature
- Vibrance
- Saturation
- Hue
- HSL
- RGB
- Color Matrix
- Sepia
- Skin Tone
- False Color (mix between two colors using luminance)
- Monochrome
- Grayscale
- Color Invert
- Highlight/Shadow/Tint
- Levels (like Photoshop)
- Opacity
- Image Blending (supports 27 Photoshop modes)
- Haze (add/remove)
- Haze Removal (Dark Channel Prior)
- Retinex (Multi-Scale with Color Restoration)
- Backlight Repair (corrects extremely low or non-uniform lighting)
- Highlight/Shadow
- Lookup (Remap Colors/LUT)
- Chroma Key (Color Key / Remove Specific Color)
- Posterize
- Palettize
- from file (remaps colors to closest color in palette file with optional dithering)
- from image (reduces unique colors using color quantization with optional dithering)
- Opacity
- Image Blending (supports 27 Photoshop modes)
- Auto Contrast
- Auto Gamma Correction
- Auto Level
- Auto White Balance
- Auto Threshold
- Bilateral (selectively blurs preserving edges and other details)
- Average (Mean) Blur
- Gaussian Blur
- Box Blur
- Motion Blur
- Zoom Blur
- Median Blur
- Radial Blur
- Surface Blur
- Skin Smoothing
- BEEPS (Bi-exponential Edge-preserving Smoothing)
- Exponential Blur
- Guided Filter
- Erode/Dilate
- Min/Max
- High Pass
- Unsharp Mask
- Sharpen
- Canny Edge
- Gradient Edge
- Sobel Edge
- Laplacian Edge (Laplacian of Gaussian)
- Roberts Edge
- Prewitt Edge
- Oil Paint
- Frosted Glass
- Film Grain
- Relief (Emboss)
- Mosaic
- Pointillize
- Color Halftone
- Fragment
- Crystallize
- Kaleidoscope
- Pinch
- Polar Coordinates
- Ripple
- Spherize
- Twirl
- Wave
- Clouds
- Despeckle (Salt & Pepper Noise Removal)
- Deskewing
- 2D Convolution
- Resampling (resize) [Nearest-neighbor, bilinear, bicubic and lanzcos]
- FFT (Fast Fourier Transform) [Low-pass, high-pass, band-pass, band-stop, custom]
- FFT Visualization (outputs frequency domain)
- Retrieve average image luminosity
- Retrieve average color
- Retrieve image size
- Crop
- Flip (Vertical/Horizontal)
- Rotate image (bilinear and bicubic)
- Hough transform line detection
- Median Cut, Octree
- Ordered Bayer (4x4 and 8x8), Atkinson, Burkes, Sierra, Sierra Two-Row, Sierra Lite, Stucki, Jarvis-Judice-Ninke, Single Neighbor, Floyd-Steinberg
Note: These are primarly used for included filters and added on as needed basis.
- RGB <--> YIQ
- RGB <--> HSL
- RGB <--> HSV
- RGB <--> YCbCr
- RGB <--> CMYK
- RGB <--> CIELab
| File Extension | Name | Read | Write |
|---|---|---|---|
.aco |
Adobe Color Swatch | β | β* |
.act |
Adobe Color Table | β | β |
.ase |
Adobe Swatch Exchange | β | |
.gpl |
GIMP Palette | β | β |
.pal, .psppalette |
Paint Shop Pro Palette | β | β |
.pal |
Microsoft RIFF Palette | β | β |
.txt |
Paint.NET Palette | β | β |
NOTE: *RGB only.
To compile the library, simply do the following:
cmake .
makeThis will out the following 4 files:
- static library
lib\libocular.xxx - dynamic link library
bin\ocular.dll - cli image demo
bin\demo.exe - cli palette demo
bin\palette.exe
Ocular is under the MIT license.
See the LICENSE file for details.
