This code snippet:
System.Drawing.Imaging.Encoder.Quality
is how you control compression. The lower the value, the lower the resolution. Valid values are 0-100. If you'll notice, the image has to be in memory (as opposed to in a file) in order to affect the level of compression for the image, and then you need to save it back to disk (maybe with a different filename?).
Here's a link that fully explains the property and its use:
Encoder.Quality Field (System.Drawing.Imaging) | Microsoft Docs[
^].
You really should make better use of your time by learning how to use google. Furthermore, how can we help you with someone else' code unless you can answer specific questions about it? If you don't understand what it's doing, we generally won't be able to provide effective help.