Comments on: JPEG and PNG – lossy and lossless image compression https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/?s_tid=feedtopost Retired from MathWorks in 2024 after 30 years of service. Can now be found at MATLAB Central, https://hornjourney.com, and https://matrixvalues.com. MathWorks career included image processing, toolbox development, MATLAB development and design, development team management, MATLAB design standards, Steve on Image Processing blog (https://blogs.mathworks.com/steve). Co-author of Digital Image Processing Using MATLAB (https://www.imageprocessingplace.com/DIPUM-3E/dipum3e_main_page.htm). French horn enthusiast, member of Concord Orchestra and Melrose Symphony, member of the board of Cormont Music and the Kendall Betts Horn Camp. Fri, 01 Nov 2019 13:16:19 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Steve Eddins https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26485 Tue, 14 May 2013 18:07:50 +0000 https://blogs.mathworks.com/steve/?p=835#comment-26485 Neo—The imfinfo function returns some metadata information about a JPEG file, but it does not include the quantization table or Huffman code.

]]>
By: Piyush https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26401 Tue, 07 May 2013 17:56:21 +0000 https://blogs.mathworks.com/steve/?p=835#comment-26401 Nice explanantion. Thanks

]]>
By: Knut https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26398 Tue, 07 May 2013 08:04:33 +0000 https://blogs.mathworks.com/steve/?p=835#comment-26398 While PNG in itself is lossless, I believe that it is possible to pre-process the raw input to PNG in such a manner as to reduce the final filesize.

An obvious approach would be to reduce the number of unique colors.

Perhaps this was what the user thought about?

]]>
By: Neo https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26397 Tue, 07 May 2013 04:56:17 +0000 https://blogs.mathworks.com/steve/?p=835#comment-26397 Is there a method to extract jpeg header, or signature including quantization table and huffman code with matlab?

]]>
By: jurgen https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26369 Fri, 03 May 2013 11:40:21 +0000 https://blogs.mathworks.com/steve/?p=835#comment-26369 For PNG the proper name for such a parameter would not be “quality” but “compression” or something similar. Come to think of it, maybe the JPEG parameter should be called “qualpression” instead!

]]>
By: Tometheus https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26358 Fri, 03 May 2013 00:23:51 +0000 https://blogs.mathworks.com/steve/?p=835#comment-26358 I came here to essentially say what David said. Perhaps the person meant to ask about a compression level parameter, which AFAIK MATLAB doesn’t implement.

Most people are used to PNGs (via ZLIB) offering 10 compression levels.

http://www.libpng.org/pub/png/book/chapter09.html#png.ch09.div.2

]]>
By: David https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26355 Thu, 02 May 2013 21:33:21 +0000 https://blogs.mathworks.com/steve/?p=835#comment-26355 Perhaps the original requester was thinking of the time/size compression trade-off for png images? Because the png format is based around general data-compression methods, it is possible to “spend” more computing time to look for smaller encodings of the same image (still lossless, but more efficient).

There are programs like pngcrush that repeatedly try different pre-filters, and spend more time on the DEFLATE step, to try to make smaller files. That kind of option in MATLAB would sometimes be useful – you could choose low compression when saving many temporary images, or highest compression when the image will be published to the web.

]]>