d2phap / ImageGlass

🏞 A lightweight, versatile image viewer
https://imageglass.org
Other
7.57k stars 491 forks source link

Add support for reducing the size of image with lossless compression #1518

Closed dlemstra closed 4 months ago

dlemstra commented 1 year ago

The Magick.NET library contains an ImageOptimizer that can be used to reduce the size of an image with lossless compression. Would you be open to a pull request that adds support for this to ImageGlass? Not sure where should be added in the menu though. Maybe in the Image menu? And would you be okay with this only be added to the v9 branch?

d2phap commented 1 year ago

v9 is a good branch! Note that the source code of v9 is in the v9 folder. Since the upcoming v9.0 beta 4 will support "Tools" menu, including built-in and external tools. This ImageOptimizer can be added as a built-in tool, may be called Image optimizer, in the Tools menu.

You can add a new ToolstripMenuItem called MnuImageOptimizer.


For the external tools, it's loaded via the settings Tools in igconfig.json. The Exif tool from v8 will be decoupled as a standalone tool. Currently, I put a placeholder for it in the Tools menu:

image

The setting for external tool is as below: https://github.com/d2phap/ImageGlass/blob/633d457ce3347765a6c39b97afe6349d411a6fe6/v9/Components/ImageGlass.Settings/Config.cs#L735-L748

d2phap commented 4 months ago

This feature is added in ImageGlass 9.1 Beta

image

image