Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Quality and Compression with system.drawing.imaging?

I'm completely new to image processing in ASP.NET. I am very familiar with Photoshop, and image magick to some degree.

I am trying to figure out what the difference is between Quality and Compression as other apps tend to treat them as the same. With system.drawing.imaging there's settings for Quality and Compression.

http://msdn.microsoft.com/en-us/library/system.drawing.imaging.encoder.quality.aspx reads: "The Quality category specifies the level of compression for an image."

http://msdn.microsoft.com/en-us/library/bb882583.aspx reads: "A quality level of 0 corresponds to the greatest compression, and a quality level of 100 corresponds to the least compression."

The documentation seems to use Quality and Compression interchangeably. However, there's settings for each. What's the difference?

like image 903
user1337 Avatar asked Aug 08 '12 22:08

user1337


People also ask

What is encoder Quality?

The Quality category specifies the level of compression for an image. When used to construct an EncoderParameter, the range of useful values for the quality category is from 0 to 100. The lower the number specified, the higher the compression and therefore the lower the quality of the image.


2 Answers

The Quality encoder parameter has values from from 0-100 that will dictate the amount of compression that can be applied for certain encoders, 0 for maximum compresssion, and 100 for minimum compression.

The Compression encoder parameter specifes the type of compression applied for certain encoders. The value of this depends on the codec, but a (theoretical) GIF encoder might have VersionGif87 or VersionGif89 as possible values.

like image 183
Monroe Thomas Avatar answered Oct 23 '22 10:10

Monroe Thomas


The quality encoding parameter is what you would expect, and have quoted a value from 0-100 which tells the processor what quality you want your image to be saved at. The Compression parameter defines the type of compression the encoder will use. Here are all the valid compression types: http://msdn.microsoft.com/en-us/library/system.drawing.imaging.encodervalue.aspx

Hope this helps.

like image 3
Jay Avatar answered Oct 23 '22 11:10

Jay