"Developer creates 'Quite OK Image Format' – but it performs better than just OK". ^ "GraphicConverter Release Notes version 11.8 (build 5762)".^ "History of IrfanView Changes/Versions"."How PNG Works: Compromising Speed for Quality". ^ a b "Lossless Image Compression in O(n) Time".The red and blue channels (dr and db) base their diffs off of the green channel difference. The green channel is used to indicate the general direction of change and is encoded in 6 bits. 4-bit blue channel difference minus green channel difference -8.7.4-bit red channel difference minus green channel difference -8.7.6-bit green channel difference from the previous pixel -32.31.The alpha value remains unchanged from the previous pixel. Values are stored as unsigned integers with a bias of 2. The difference to the current channel values are using a wraparound operation, so 1 - 2 will result in 255, while 255 + 1 will result in 0. 2-bit blue channel difference from the previous pixel -2.1.2-bit green channel difference from the previous pixel -2.1.2-bit red channel difference from the previous pixel -2.1.6-bit index into the color index array: 0.63Ī valid encoder must not issue 2 or more consecutive QOI_OP_INDEXĬhunks to the same index.The byte stream's end is marked with 7 0x00 bytes followed by a single 0x01 byte. A decoder must check for the presence of an 8-bit tag first. The 8-bit tags have precedence over the 2-bit tags. All values encoded in these data bits have the most significant bit on the left. The bit length of chunks is divisible by 8 - i.e. Index_position = ( r * 3 + g * 5 + b * 7 + a * 11 ) % 64Įach chunk starts with a 2- or 8-bit tag, followed by a number of data bits. In the encoder, if the pixel value at the index matches the current pixel, this index position is written to the stream as QOI_OP_INDEX. Each pixel that is seen by the encoder and decoder is put into this array at the position formed by a hash function of the color value. Values is maintained by the encoder and decoder. A running array (zero-initialized) of previously seen pixel The color channels are assumed to not be premultiplied with the alpha channel (“un-premultiplied alpha”). Full r,g,b or r,g,b,a values ( QOI_OP_RGB or QOI_OP_RGBA).a difference compared to the previous pixel value in r,g,b ( QOI_OP_DIFF or QOI_OP_LUMA).an index into the array of previously seen pixels ( QOI_OP_INDEX).Run-length encoding of the previous pixel ( QOI_OP_RUN). An image is complete when all pixels specified by width * height have been covered. A full list can be found on the project's Git(Hub) repository README.Ī QOI file consists of a 14-byte header, followed by any number of data “chunks” and an 8-byte end marker. There are also implementations for various languages such as Rust, Python, Java, C++, C# and more. Ĭommunity made plugins are available in GIMP, Paint.NET and XnView MP. QOI is supported natively by ImageMagick, IrfanView (as of version 4.60), FFmpeg (as of version 5.1), and GraphicConverter (v11.8+). The author has donated the specification to the public domain ( CC0). Figures specified in the announcement and the video claim twenty to fifty times faster encoding, and three to four times faster decoding speed compared to PNG, with similar file sizes. A third party YouTube video explains how PNG and QOI compression are performed. The intended purpose was to create an open source lossless compression method, that was faster and easier to implement than PNG. The Quite OK Image Format ( QOI) is a specification for lossless image compression of 24-bit (8 bits per color RGB) or 32-bit (8 bits per color with 8-bit alpha channel RGBA) color raster (bitmapped) images, invented by Dominic Szablewski and first announced November 24th 2021.
0 Comments
Leave a Reply. |