Tag Archives: compress files

Compress and decompress directories in C#

The ZipFile class provides remarkably simple methods to compress and decompress directories in the zip format. This class is defined in the .NET Framework version 4.5, so this example is in Visual Studio 2017 instead of an older version. To … Continue reading

Posted in classes, directories, files | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Compress JPG files in a directory in C#

I wrote this example to help produce reduced-size versions of some of the thousands of pictures I’ve collected over the years. Unfortunately pictures you take with a modern camera or phone tend to be enormous. Fortunately most of my relatives … Continue reading

Posted in algorithms, files, graphics, image processing, tools | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Quickly pick JPG compression level in C#

The example Compress JPG files to a certain size in C# lets you adjust a file’s JPG compression level until it is no bigger than a specified size. It does that by starting at a compression level of 100 and … Continue reading

Posted in algorithms, files, graphics, image processing | Tagged , , , , , , , , , , , , , , , , , | 1 Comment

Compress JPG files to a certain size in C#

The example Optimize JPEG compression level and file size in C# shows how to save a JPG file with different compression levels. Using a smaller level makes the resulting file smaller but introduces more error into the image. If you … Continue reading

Posted in algorithms, files, graphics, image processing | Tagged , , , , , , , , , , , , , , , , | 1 Comment

Use the DotNetZip library to compress and decompress files in C#

Background Normally I don’t like to require third-party libraries. I don’t know what tools you have loaded on your system and I don’t want to assume you can load new tools without creating conflicts. If third-party tools get out of … Continue reading

Posted in files, system | Tagged , , , , , , , , , , , , | 1 Comment