Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Largest file size for a JPEG file with a fixed resolution [closed]

Tags:

jpeg

Is there a way to calculate the largest possible file size for a JPEG image with a fixed resolution?

For example, is it possible to say that a 1024x768 image has a maximum file size of 3MB?

like image 575
Romain Moreau Avatar asked Oct 21 '25 21:10

Romain Moreau


2 Answers

No there is not. It uses quantization matrices to try and reduce frequencies to 0, depending on how good that works, and how much of a pattern occurs for all these values, the compression becomes more efficient.

See JPEG Wikipedia Article, section Codec Example for more details on how the compression works. It should become clear from that that it is not possible.

like image 176
Yuri Avatar answered Oct 24 '25 11:10

Yuri


Not really. JPG compression depends on quality settings, and the content of the image. A single solid color "tile" will compress far better than a "busy" image.

E.g. a solid white 800x600 image saved in The Gimp at 85% quality is a 3,155 bytes .jpg file. Filling that same 800x600 image with the RGB noise filter produces a 134,935 byte .jpg.

like image 25
Marc B Avatar answered Oct 24 '25 10:10

Marc B