elroyflynn Posted March 16, 2010 Share Posted March 16, 2010 In the file/save dialogue, the quality slider: Obviously it can be used to reduce image quality, resulting in a smaller file size, but what is it doing? Thanks, Elroy Quote Link to comment Share on other sites More sharing options...
pyrochild Posted March 16, 2010 Share Posted March 16, 2010 Obviously it can be used to reduce image quality, resulting in a smaller file size You seem to already have the hang of it. This image shows a progressive quality decrease going from left to right. Lower quality allows the image to have a smaller file size. Are you asking about the technical aspect of exactly how the JPEG algorithm decides what details can be destroyed in the interest of compression? 'Cause, well, I dunno. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
elroyflynn Posted March 16, 2010 Author Share Posted March 16, 2010 Yes, I'm asking technical. Is it a parameter to the jpeg algorithm? or is it doing some kind of pre-processing that results in better compression? For example, it making be making nearly-identical colors actually identical, so that jpeg will compress more. Quote Link to comment Share on other sites More sharing options...
pyrochild Posted March 16, 2010 Share Posted March 16, 2010 It'll be via a parameter rather than pre-processing it. Beyond that, your questions are outside the scope of this forum. The Wikipedia entry is a good starting point, should you still be curious. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 16, 2010 Share Posted March 16, 2010 Yes it's a parameter to the JPEG codec. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
wheany Posted March 16, 2010 Share Posted March 16, 2010 A bit more detailed answer: JPEG works by changing each 8x8 pixel block in the image into frequency domain (using discrete cosine transform, if you want to look it up). These frequencies have amplitudes. Before they are compressed, the JPEG compressor divides the amplitudes with a value and saves that value to the file. It's an integer division, so it loses information. Pretend there's a 2x2 pixel image. When converted to frequency domain, its amplitudes might be something like 37 36 30 21 If you divide all these values by 1 before compression, you have lossless compression, since when you decompress, you get the exact same values back. If you (integer) divide all these values by 2, they become 18 18 15 10 And when you decompress the file, by multiplying the saved values by 2, you get 36 36 30 20 These are not exactly the same values as were put in, so the compression becomes lossy. Divide by 10 and you get 3 3 3 2 Which becomes 30 30 30 20 upon decompression, which is already quite a significant difference to the original. On the other hand, the preprocessed data contains a lot of repetition (3, 3, 3, 2), which is easy to compress, so the file becomes smaller. That is what the JPEG quality option does on a technical level. Smaller quality values = bigger divider = more quality loss. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.