This encoder is very naive as it only output SOF0 images and uses pre-defined Huffman tables. There is also a small bug with quantization which make using it over-degrade the quality.