We found out that run length is much better than huffman coding (JAVA) considering compression ratio. Is it true for all cases?
Of course not. Consider ABABABAB
, it will compress better with huffman than run-length encoding.
Run length will only work for data that have repeated values; that's not guaranteed in images.