Skip to content

bpanthi977/qoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

QOI

QOI is a Common Lisp library for reading and writing QOI (Quite OK Image Format) files.

decoding/reading

decode takes an input stream of octets and decodes it to an image. image is an 1D array of size width * height * channels (channels = 3 for RGB file and = 4 for RGBA file).

To decode a qoi file simply:

(with-open-file (stream #p"./dice.qoi" :element-type '(unsigned-byte 8))
  (decode stream))

decode returns multiple values: (values image width height channels colorspace).

encoding/writing

encode takes an binary output stream and an image array then encodes the image and writes it to that stream.

To encode and save an image to output-file simply:

(with-open-file (stream output-file
                        :direction :output
                        :if-exists :supersede
                        :element-type '(unsigned-byte 8))
  (encode stream image width height channels colorspace))

License

MIT

About

QOI Format encoder/decoder for Common Lisp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published