A high-performance Common Lisp library for representing and processing 2D pixel-based images with minimal dependencies.
Opticl is a lightweight image processing library for Common Lisp designed to balance performance, simplicity, and broad applicability. It provides efficient operations on 2D pixel-based images using Common Lisp's native array types and compiler optimizations, enabling high-performance pixel manipulation with minimal abstraction overhead.
Common Lisp developers working on image processing tasks, such as scientific computing, computer vision, or graphics applications, who need efficient, low-level pixel manipulation without heavy dependencies.
Developers choose Opticl for its direct use of Common Lisp arrays and compiler features like type declarations and multiple values, which enable high-performance, non-consing pixel operations, distinguishing it from other libraries that rely on CLOS classes or external matrix libraries.
An image processing library for Common Lisp
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Images are stored directly as Common Lisp arrays, allowing for zero-abstraction pixel access and efficient memory use, as demonstrated in the non-consing loop example.
Leverages SBCL's compiler with type declarations to inline functions, enabling fast, non-consing pixel operations—shown in the timing example with 6ms for full image processing.
Uses Common Lisp's multiple values to represent pixel channels, avoiding heap allocation for color data and streamlining operations like pixel reading and writing.
Reads and writes PNG, JPEG, TIFF, and other formats via established libraries, though this comes with external dependencies managed through Quicklisp.
Optimizations heavily depend on SBCL-specific features and CLtL2 functions; support for other Common Lisp implementations is limited and untested, reducing portability.
For optimal performance, users must manually add type declarations (e.g., (declare (type 8-bit-rgb-image img))), adding complexity and potential for errors in code.
File format support requires multiple external libraries (e.g., zpng, cl-jpeg), which can complicate deployment, increase setup time, and introduce version compatibility issues.