问题标签 [lossless-compression]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
1310 浏览

c - 任何人都可以制作这个插口算法代码 Pitiny.c 的头脑或故事吗?

这个C程序只有 143 个字符长!

但它会“解压缩”为Pi的前 10,000 位数字。

当我遇到这个时,我正在对无损压缩算法进行一些研究,但仍然没有运气pitiny.c

奇怪的是它编译成功,没有错误或错误,但就像我说的那样,我无法对代码做出头脑或故事,甚至它的语法。我只是想知道这是怎么回事?它到底在做什么?

0 投票
1 回答
811 浏览

matlab - Decode lossless predictive coding

In MATLAB, I did lossless predictive coding of standard images by predicting the next sample from previous samples, subtracting the predicted value from the actual one, and encoding the error using Huffman coding. I decoded the errors as well, but now I have an array of errors without knowing how to go back to the original image. How do I predict the values of the original image matrix from these errors?

Just in case this helps, my predictor is of different types (to see which one gives the best result), with X being the actual value of a sample: 1) I take three neighboring values of X, find their average, and subtract them from X to obtain the error. 2) I used the predictor (A+B)/2, where A and B are neighboring values of X, and subtract from X.

And others like that. There's a pretty comprehensive list out there.

Any advice on how to predict the original values at the decoder?

0 投票
3 回答
600 浏览

algorithm - 压缩大约 200 万个数字的序列的最佳方法是什么(值范围是 1-->28)

我正在尝试压缩整数列表,其中:

  • 没有负数。
  • items的取值范围是从[1....28]
  • 列表中共有2482113项。
  • 目前我使用5 位来存储每个数字。
  • “出现”的统计数据如下

    • 1:1242149
    • 2:620038
    • 3:309399
    • 4:154983
    • 5 : 77816
    • 6:38601
    • 7 : 19651
    • 8 : 9790
    • 9 : 4830
    • 10 : 2447
    • 11 : 1253
    • 12 : 597
    • 13 : 303
    • 14 : 130
    • 15 : 73
    • 16 : 23
    • 17 : 17
    • 18 : 4
    • 19 : 4
    • 20 : 2
    • 21:1
    • 23:1
    • 28 : 1

所以请告诉我压缩这种数据的最佳方法(估计压缩率 - 如果可能的话 - 非常感谢)。

0 投票
0 回答
154 浏览

java - 压缩 ODB 文件

我需要压缩大于 1GB 的大型 ODB 文件。我使用了 LZMA 算法,最多可以压缩 22%。有没有更好的方法以更好的压缩比压缩这些类型的文件?压缩必须是无损的。

0 投票
6 回答
35972 浏览

python - Compress numpy arrays efficiently

I tried various methods to do data compression when saving to disk some numpy arrays.

These 1D arrays contain sampled data at a certain sampling rate (can be sound recorded with a microphone, or any other measurment with any sensor) : the data is essentially continuous (in a mathematical sense ; of course after sampling it is now discrete data).

I tried with HDF5 (h5py) :

but this is quite slow, and the compression ratio is not the best we can expect.

I also tried with

but once again it may not be the best compression algorithm for such data (described before).

What would you choose for better compression ratio on a numpy array, with such data ?

(I thought about things like lossless FLAC (initially designed for audio), but is there an easy way to apply such an algorithm on numpy data ?)

0 投票
0 回答
956 浏览

java - 我们如何读取无损压缩的 JPEG 图像

我有一些医学图像,它们被压缩为无损图像。这些图像只能在 matlab 和 accusoft Java API 中读取。

我们如何在java中加载这些类型的图像?

我目前的代码是:

但我得到了例外:

请帮我解决这个问题。

0 投票
3 回答
7829 浏览

amazon-web-services - 是否可以使用 Cloudfront 进行无损压缩?

我正在运行一个城市景观和自然摄影网站,其中包含许多大小从 50kb-2mb 不等的图像。我已经使用批量照片编辑器缩小了它们的尺寸,所以我不能在图像中失去任何质量,而不会让它们变得太粗糙。

谷歌页面洞察力推荐无损压缩,我正试图弄清楚如何解决这个问题。这些特定图像位于 s3 存储桶中,由 AWS Cloudfront 提供服务

无损压缩https://d339oe4gm47j4m.cloudfront.net/bw107.jpg可以节省 57.6KiB(减少 38%)。无损压缩https://luminoto-misc.s3-us-west-2.amazonaws.com/bob_horsch.jpg可以节省 40.6KiB(减少 42%)。......还有一百多个相同的。

Cloudfront 可以在图像作为服务器到客户端之前进行压缩吗?或者我是否必须进行其他类型的压缩,然后将每个文件重新上传到新的 s3 存储桶。我正在寻找云端可以做到的解决方案。

我四处寻找,但没有找到明确的答案。

谢谢,杰夫

0 投票
0 回答
389 浏览

php - 将 Smush.it 添加到我的图像大小调整脚本

这是来自我的班级的一个名为“Image”的 PHP 片段。

这是我课堂上的完整功能

然后我想在保存修改后的文件之前使用 Smush.it 压缩这个新调整大小的图像。

我在GitHub GhislainPhu/php-lib-smushit找到了这个代码行,但我不确定如何在我自己的类中调用这个类。

谁能帮我?这将对提高页面速度有很大帮助。

0 投票
3 回答
186 浏览

c++ - Storing Probability table during text compression

I am doing a project where I compare different types of Text compression methods such as Huffman and Arithmetic for both static and adaptive form. I make a probability table for both using the number of occurrence of each letter in the text. Now, for adaptive form, the receiver does not need the Probability table but for the static form, we need to transmit this probability table as well to the receiver for decoding the message. Now this storing of the table will need some extra bits, which should be taken into account while comparing.

So my question here is:

  1. What is the best solution for storing the probability table (in a file).
  2. What is the minimum number of bits required to do that? (I know it depends on the text, but is there some way to find the minimum bits required to store the table).

Thank you very much.

0 投票
1 回答
800 浏览

image - 无损JPEG2000中的量化误差(Matlab)

我有以下矩阵:

我想使用 JPEG 2000 压缩它,然后恢复数据。我在MATLAB中使用imwriteimread如下:

MATLAB 给我结果uint8。将数据转换为后,double我得到:

我知道这是因为量化,但我不知道如何解决它并获得准确的输入数据,这是无损压缩应该做的。

在开始时将数据转换为uint8没有帮助。