How to know what pixels where compressed and not compressed in a image?
2 次查看（过去 30 天）
Havin a image (jpg or png - I can have lots of extensions) it's possible to know what them was compressed?
For exemple, let's say that I have a 1280 x 720 image. Than in a uncompressed image I will have a 1280 x 720 matrix of int values representing the image.
But if the same image is compressed (if possible), will be less then that.
My goal: I need to process a image (compressed) and have a vector of ones and zeros representing their pixels. The ones means that the pixel in that position it's important and wasn't compressed. Otherwise, zeros means that this particular pixel is not important and was compressed.
William Rose 2022-11-28
It is not true that specific pixels are compressed or not compressed whn an image is compressed. The JPEG algorithm does a color transofrm on the entire eimage, then the chrominance component of color (at every pixel) is downlsized. This means that the color information at each pixel is now more coarse than originally. Then the image is divided into 8x8 pixlel cheunks, and each chuink is processed with a dicrete cosine transoform, and discarding the higher frequencies from each 8x8 black. Therefore this comptession step also does not keep or reject specific pixels. The last compression step, Huffman coding, also compresses in a way that is not pixel-specific.
PNG and other compression algorithms are also complex, like JPEG, and do not correspond to keeping or rejecting specific pixels.