13

It depends how you define the term "information" or "entropy". The conventional definition of entropy of an image is to think the image as a two-dimensional matrix of pixels and $$H = - \sum_k p_k \log_2(p_k),$$ where $p_k$ is the probability, which is calculated from histogram, associated with gray level $k$. This kind of entropy is correct if we ignore ...


11

The lossless JPEG compression does not merely remove small coefficients in higher frequencies. It encodes them with a precision relative to a (relatively crude) visual perception model; most notably, horizontal and vertical frequencies are not quantized with the same precision. And as in many compression formats, it essentially assumes that the data is ...


10

The composition below shows a fractal kind structure of the pattern. The every next picture is the result of averaging over each 2x2 pixels block of the previous one. The total character of the pattern remains the same but the image contrast is gradually decreasing. As it was said right earlier, the picture becomes grey when we zoom out. But using the ...


9

Actually, it's kind of the other way around. If you reuse the same JPEG encoder at the same quality level (without any smoothing steps as built-in prepcosessing) and a decoder which faithfully decompresses the images, I expect the image quality not to degrade from generation to generation. This is because quantization (the lossy part) is done the same way ...


8

I don't think that repeated jpg compression reduces to a single flat color. I tried compressing-decompressing an image 3 times. (Using GIMP 2.8.2, at quality level "10%" with progressive, exif, thumbnail and xmp all turned off, 4:2:2 vertical subsampling and integer DCT.) All three images are identical (Linux cmp turns up no differences at all between the ...


8

The PNG format is lossless for RGB24 image data. However the conversion from YUV to RGB24 is not lossless, as the two formats quantize the color space differently. To see this, the following animated gif was made by applying your two ffmpeg operations 200 times back-and-forth and collating the resulting 200 images into the gif. By contrast, the following ...


6

From the images you posted its quite clear that the image has been downsampled and re-compressed with lower quality jpeg settings. If you look round the mouth you can clearly see JPEG-like artefacts.


6

Simply because the highest compression typically is significantly more CPU-intense (it tries out multiple different approaches to represent successive lines). This really shouldn't make much difference on a modern PC for saving a few images. Then again, in practice, libpng seems to be pretty slow, so this might make a difference, especially for people ...


6

[EDIT] In 1991, Nasir Ahmed wrote: "How I Came Up with the Discrete Cosine Transform". Interesting to read, on how he was inspired by Chebyshev polynomials, and on how he didn't get funding, for a tool at the heart of JPEG and MP3. Natural images are not very stationary, but locally, their covariance is often modeled by a first- or second-order ...


5

Are there images that are better suited to testing compression quality than others? You are exactly right. A good compression algorithm is one that performs well on average considering all those types of images. In reality, a database of different types of image is used to evaluate a particular compression techniques. Maybe an image of diagonal lines of ...


4

All images blocks that are applied by DCT matrix have a valid IDCT - i.e. they can always bring back original pixels and in general inverse transfer is theoretically as well as computationally viable. However, while your pixels have values in range 0-255 - the DCT matrix of the block never results in values which are confined between 0-255. Not only that, ...


4

For real images, there is indeed a formal redundancy, termed Hermitian or conjugate-symmetric as detailed by @Fat32. This symmetry however is "modulated" by the complex expression of the Fourier coefficients. So the FFT requires half the number of coefficients, but twice the amounts, due to the real/imaginary or modulus/phase couples. All in all, the ...


4

Neither. A true compression ratio is: "original file size in bits" divided by "compressed file size in bits". A practical (based on disk limits) compression may embed the chunk size effect: "original file size in number of chunks" divided by "compressed file size in chunks", less favorable. Some of the main reasons for "neither" are: DCT is not the ...


4

General Idea The general idea of Principal Component Analysis (PCA) is as following (Intuition over formalism): Given a set of points in space (Inner Product Space) find a set of vectors (Directions) which are uncorrelated which span the data in the most energy preserving manner. The tricky part is explaining "most energy preserving manner". So we're ...


3

Both JPEG and JPEG 2000 use the change of basis compression type. Namely, we transform the data into a different representation assuming in this representation the number of parameters needed to describe to data is lower. Or to the least, most of the information is gathered within few parameters. Now, if you look at the energy level of the DCT coefficients ...


3

JPEG is far simpler. It divides the image into 8x8 pixel blocks, and processes each using a Discrete Cosine Transform. The results are quantised and then encoded. The quality is fixed by the encoder. JPEG2000 uses a 2D wavelet function, the output of which is four "images", each a quarter the size of the original. One of those is actually an image, ...


3

A common wavelet based standard is JPEG 2000 and a common DCT based standard is JPEG. JPEG 2000 uses wavelets, but a good portion of the better compression it achieves than JPEG is due to the fact that JPEG uses a much much simpler entropy coder (JPEG does context-dependent Huffman codes and run length coding, JPEG 2000 does arithmetic coding with some ...


3

The filling is performed to the right ($[1\,,1\,,3\,,x_1\,,x_2\,,x_3\,,x_4\,,x_5]$) or the bottom ($[1\,,1\,,3\,,y_1\,,y_2\,,y_3\,,y_4\,,y_5]^T$), line by line or column by column. The extended values, as far as I know, are not fixed, and they depend on the encoders choices. Remember that blocks are formed on luminance/chrominance transformed images, after ...


2

Here is another approach gaining RGB Brownian noise (4096x4096 GIF).


2

Random noise indeed compresses very poorly. You can produce it in color by generating independent R, G, B values. Looking from a distance will indeed wipe away the noise (by lowpass filtering), and you can avoid that by generating noise images at different resolutions, i.e. using bigger and bigger pixels, and superposing them. When adding the images, you ...


2

Let me share the pattern that has a very flat spectrum (like the white noise). So this pattern is very hard to compress with JPG. The sample image below is enlarged 4 times. The pattern itself is regular, but non-periodic, and could be easily generated by the deterministic algorithm. It also has a fractal property. Viewed from far away:


2

Oftentimes some rounding occurs in storing the coefficients. This is why many image compression algorithms are lossy, i.e. they lose information when converting the floating point coefficients to integer format. The process of rounding is called quantization. See this wikipedia article for an example. http://en.wikipedia.org/wiki/JPEG#Quantization


2

First of all, there are many solutions. Something better under one measure may be worse under another measure. So first you need to think about what is your quality measure(s) to evaluate a restored image. Commonly, people use the "mean square error (MSE)" (or its log version, known as the peak signal noise ratio). Assume the ground-truth image is $X$, and ...


2

The 3-digit number describes the subsampling of the chroma (U and V) channels. A detailed explanation is at http://en.wikipedia.org/wiki/Chroma_subsampling In particular, YUV420 means that the U and V channels have half the resolution of the luma (Y) channel, in the horizontal and vertical directions. The sampling method usually present in low to medium ...


2

I just answered this in Stack Overflow. Here's the answer again: The PNG pixels are in RGBA order, not ARGB, so you'd need to write alpha | red<<24 | green << 16 | blue <<8 But you are writing color type 2, so your pixels should be 3 bytes each instead of four; you can't really encode them in 4-byte integers as you've done. So either ...


2

ImageMagick's "identify -verbose" says it's JPEG. The sample image here has quality 77, while several recent ones of mine that I checked just now have either "quality 71" or "quality 74". All of them have 2x downsampling of the chroma channels. Most of the time I have uploaded high-quality (IJG quality 92) JPEGs without donwsampling. Some have Facebook's "...


2

Shannon's entropy only makes sense when you define it over a probability distribution. You're using a probability distribution where each pixel is sampled independently from the histogram of pixel intensities. Clearly, real pictures don't come from such a distribution. If they did, they would all look like white noise. Also note that individual elements don'...


2

An image (2D) is the projection of a natural scene or man made drawing on to a plane. The output of an optical sensor when displayed is an image. Texture is a picture created by repeating a basic element called 'texel'. The texel can be a natural image or an artificial one. The edge detection algorithms works on matrices. So if it is a normal image or ...


2

It's a probabilistic model that is assumed to generate the image. To make theoretical computations on the performance of certain image processing tasks such as DCT transforming the image for data compression, the image is modelled with a simple mathematical equation. The Markov image generation model, is used to produce images where there will be high ...


2

The typical thing to do is the low-rank approximation on separate channels. Assume that $C$ is a channel of the RGB image $I$: rank = 10; [U,S,V] = svd(C); L = U(:,1:rank) * S(1:rank, 1:rank) * V(:, 1:rank)'; Now, L should be the compressed image. If you do this operation and compose the channels back, you should get a compressed RGB image. However, such ...


Only top voted, non community-wiki answers of a minimum length are eligible