3 ms·
JPEGs were never meant to be <1KB, so the header can be rather large-- looking at one example, the truncated JPEG data Instagram sends is 248B, and the addition
by Scaevolus 7y ago
JPEGs were never meant to be <1KB, so the header can be rather large-- looking at one example, the truncated JPEG data Instagram sends is 248B, and the additional fixed header information is 607B, resulting in an 848B thumbnail (the truncated data includes dimensions).
That 607B of fixed header includes some compression settings that don't need to change between images:
- 132B of quantization tables, saying how much to divide every coefficient by-- for subtle details the difference between "128" and "129" doesn't matter, and you can just send "2 * 64".
- a 418B Huffman table, which stores the frequencies of different coefficient values after quantization-- small values are much more common than large ones, given the divisors. You can have smaller image data with properly tuned tables, but that only matters for large images. For 250B of image data, it's a waste.
- Miscellaneous other details that are fixed, like the file type magic headers, the color space information, and start/end markers.
You can dig in more by putting a thumbnail like https://i.imgur.com/M0EsJH1.jpg https://i.imgur.com/M0EsJH1.jpg into this site: https://cyber.meme.tips/jpdump/ https://cyber.meme.tips/jpdump/