Comment by Obscurity4340
5 hours ago
How can things be compressed without losing information or structure?
Like for text, what would that involve? How do you compress a string or multi-line string without losing information and hopefully structure (paragraphs, would it be like replacing periods and the following space with just sticking the starting capitalized letter of the following word to the previous sentence's last letter and when it decompresses theres some kind of note that converts that back into the. First letter of the next sentence
Other than what the other mentioned about finding more efficient representations, you can also compress by pre-agreeing on some common terminology.
You analyze the frequency of combinations of bytes, then replace those with high frequency with pointers to a single instance.
Deduplication ^
Because the initial content is rarely the most efficient representation, so it's possible to store fewer bytes that can deterministically be converted into the original.
Most compression algos don't care what information you're compressing. All they see (all they need to see) is bytes. It ends up being way more sophisticated than removing repeated periods and whitespace.
Like if you had eight boxes of loose lego, simply shuffling around the boxes wouldn't give you much in the way of reducing the space the legos take up. but if you took the legos (bytes) themselves out of the boxes, you end up saving a lot more space.