Zoom them yourself to see the differences.
- Main:
- Create path to input image, output location
- Call JPEG_Compress class
- JPEG_Compress
- Read Image from path get from Main
- Compress
- Export to output path get from Main
- BitCode
- A class for a huffman code, contain 2 atributes: code word and number of bit that demonstrates the code word
- BitBuffer
- A class use to store bit sequence generated in Run Length Encoding and Huffman Encoding processes.
- It contains 2 atributes: the buffer (a int number), and the number of bit that still in the buffer, waiting there to write out.
- JPG file structure
- Use default quantization table for 50% quality lost.
- Use standard huffman table that encodes the length of value instead of value it self.
- Works with: 3 color system image.
- No subsampling
- JFIF : 1.1
- It works well when compress larg size image, bring a high compression ratio, but it has a really little effect on small size image.
- Works well with non-text image.
- UI: we have no UI, this should be consider at last.
- Bad performance (comment the console log to avoid IO block, increase performance)
- Theory
- Coding