[GH-ISSUE #1069] [Feature Request] Yet another GIF Encoder #2981

Closed
opened 2026-03-01 19:05:19 +03:00 by kerem · 0 comments
Owner

Originally created by @koszeggy on GitHub (Feb 7, 2022).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1069

Originally assigned to: @koszeggy on GitHub.

I've been actually working on this already, but I didn't want to introduce an unwanted pull request without any notification.

Motivation

I really like ScreenToGif and it is very useful in a lot of cases. However, the built-in GIF Encoders have some weaknesses, especially with alpha images. Additionally, the built-in encoders do not support dithering and have only a few quantizers (eg. there is no B&W one), etc. To address these issues I included my GIF Encoder in ScreenToGif but so far it was meant for private usage only. As it proved to be quite useful for me now I ask if you are also interested in it.

📝 Note: I know about the external 3rd party GIF Encoders but I don't cover them in this issue. KGy SOFT Drawing Libraries are built for .NET, providing a direct, in-proc solution with good integration, supporting async-await, progress reporting, cancellation, etc.

Comparisons:

⚠️ Disclaimer: The new encoder does not aim to replace the existing ones. Sometimes the built-in encoders can be faster, more compact or better in other ways so it would be just a new option. The images below do not reflect the general quality difference of the encoders. It is intentionally a special example where the new encoder might be a better choice.

Animation Description Size
Original APNG image APNG Balls 363.1K
System Encoder Balls by System GIF Encoder 288.4K
STG Encoder (Default Preset) Balls by STG/Default GIF Encoder 341.9K
STG Encoder (High Quality Preset) STGHigh 347.1K
STG Encoder (High Quality • Graphics Preset) STGHighGraphics 256.6K
STG Encoder (High Quality • Transparent Background Preset) STGHighTr 320.8K
KGy SOFT Encoder (Balanced Preset) KGyBalanced 151.2K
KGy SOFT Encoder (High Quality Preset) KGyHigh 158.1K
KGy SOFT Encoder (Low Quality Preset) KGyLow 102.7K
KGy SOFT Encoder (custom preset: Wu quantizer, white background, no alpha) KGyCustomWhite 276.1K

Preview:

Still under development but now it looks like this (it also shows some of the supported quantizers and ditherers):

KGy SOFT GIF Encoder Features Preview

Bonus (offtopic):

During development I bumped into some issues regarding user settings deserialization, where I noticed the comment about looking for a better solution. As a matter of fact, I addressed the problem on a separate branch. The refactored version is 253 lines shorter than the original, and it doesn't need adjustments when using new types in user settings (such as new enums, nullables, etc). Its branch was created from the new encoder's feature branch rather than master (not published yet), and as it uses some features from the same library referenced also by KGy SOFT Drawing Libraries maybe it makes sense if I create a pull request only if the new encoder is accepted along with its dependencies.


So what do you think? Will you accept a pull request for the new encoder? If so, I could improve the user experience a bit (more tooltips/hints, etc.), and maybe I can add some localization, too. Maybe I could finish it in a week or two.

Originally created by @koszeggy on GitHub (Feb 7, 2022). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1069 Originally assigned to: @koszeggy on GitHub. I've been actually [working](https://github.com/koszeggy/ScreenToGif/tree/KGySoftGifEncoder) on this already, but I didn't want to introduce an unwanted pull request without any notification. **Motivation** I really like ScreenToGif and it is very useful in a lot of cases. However, the built-in GIF Encoders have some weaknesses, especially with alpha images. Additionally, the built-in encoders do not support dithering and have only a few quantizers (eg. there is no B&W one), etc. To address these issues I included my [GIF Encoder](https://github.com/koszeggy/KGySoft.Drawing#advanced-gif-encoder-with-high-color-support) in ScreenToGif but so far it was meant for private usage only. As it proved to be quite useful for me now I ask if you are also interested in it. > 📝 _Note:_ I know about the external 3rd party GIF Encoders but I don't cover them in this issue. KGy SOFT Drawing Libraries are built for .NET, providing a direct, in-proc solution with good integration, supporting async-await, progress reporting, cancellation, etc. **Comparisons:** > ⚠️ _Disclaimer:_ The new encoder does not aim to replace the existing ones. Sometimes the built-in encoders can be faster, more compact or better in other ways so it would be just a new option. The images below do _not_ reflect the general quality difference of the encoders. It is intentionally a special example where the new encoder might be a better choice. |Animation|Description|Size |--|--|--| | Original APNG image | ![APNG Balls](https://davidmz.github.io/apng-canvas/images/pyani.png) | 363.1K | | System Encoder | ![Balls by System GIF Encoder](https://user-images.githubusercontent.com/27336165/152840198-2de55a61-a280-4cfe-8a6b-4a6eda3c6990.gif) | 288.4K | | STG Encoder (Default Preset) | ![Balls by STG/Default GIF Encoder](https://user-images.githubusercontent.com/27336165/152840644-105dfcfd-894e-44cc-8c7a-73e69f31a6e5.gif) | 341.9K | | STG Encoder (High Quality Preset) | ![STGHigh](https://user-images.githubusercontent.com/27336165/152841076-6501a236-3817-4292-8ce9-26694ed771bd.gif) | 347.1K | | STG Encoder (High Quality • Graphics Preset) | ![STGHighGraphics](https://user-images.githubusercontent.com/27336165/152841467-795475fb-a2df-4288-b19d-bfc5b530fa8b.gif) | 256.6K | | STG Encoder (High Quality • Transparent Background Preset) | ![STGHighTr](https://user-images.githubusercontent.com/27336165/152841668-82885f19-28fa-47b6-bb82-883072c9eb38.gif) | 320.8K | | KGy SOFT Encoder (Balanced Preset) | ![KGyBalanced](https://user-images.githubusercontent.com/27336165/152842099-607b4fcb-c46c-43d0-af2b-a7ba6d9cbe42.gif) | 151.2K | | KGy SOFT Encoder (High Quality Preset) | ![KGyHigh](https://user-images.githubusercontent.com/27336165/152842544-6c962c4c-ccd1-41f1-95f2-61aa92ed3739.gif) | 158.1K | | KGy SOFT Encoder (Low Quality Preset) | ![KGyLow](https://user-images.githubusercontent.com/27336165/152842858-1af3f3e7-10e3-4947-92d5-0c03c14a7549.gif) | 102.7K | | KGy SOFT Encoder (custom preset: Wu quantizer, white background, no alpha) | ![KGyCustomWhite](https://user-images.githubusercontent.com/27336165/152860205-c71d6a39-efa2-4052-a385-5c5d8810bc18.gif) | 276.1K | **Preview:** Still under development but now it looks like this (it also shows some of the supported quantizers and ditherers): ![KGy SOFT GIF Encoder Features Preview](https://user-images.githubusercontent.com/27336165/152844903-b60c82c0-9fab-4ae8-93f7-b168308c2117.gif) **Bonus (offtopic):** During development I bumped into some issues regarding user settings deserialization, where I noticed the [comment](https://github.com/NickeManarin/ScreenToGif/blob/9cfdf56f3538277a4dfcf556535207031ac9f25a/ScreenToGif.Util/Settings/UserSettings.cs#L194) about looking for a better solution. As a matter of fact, I addressed the problem on a separate branch. The refactored version is 253 lines shorter than the original, and it doesn't need adjustments when using new types in user settings (such as new enums, nullables, etc). Its branch was created from the new encoder's feature branch rather than master (not published yet), and as it uses some features from the same [library](https://github.com/koszeggy/KGySoft.CoreLibraries) referenced also by KGy SOFT Drawing Libraries maybe it makes sense if I create a pull request only if the new encoder is accepted along with its dependencies. ---- So what do you think? Will you accept a pull request for the new encoder? If so, I could improve the user experience a bit (more tooltips/hints, etc.), and maybe I can add some localization, too. Maybe I could finish it in a week or two.
kerem 2026-03-01 19:05:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#2981
No description provided.