$ show NickeManarin/ScreenToGif
ScreenToGif is a Windows desktop application for screen, webcam, and sketchboard recording, with a built-in editor and export to animated images (GIF, APNG, WebP, AVIF), video (MP4, AVI, MKV, MOV, WebM), image sequences (BMP, JPEG, PNG), PSD, and its own project format (STG). The architecture follows MVVM with multiple projects: ScreenToGif (WPF UI), ScreenToGif.Model (domain/enums/interfaces), ScreenToGif.ViewModel (presets/tasks), ScreenToGif.Util (helpers, codification, converters, settings), ScreenToGif.Native (P/Invoke wrappers), and ScreenToGif.Test (unit tests). The application uses .NET 9 and relies on FFmpeg, Gifski, KGySoft.Drawing, and SharpDX (for DirectX capture). It features a rich set of custom WPF controls, global keyboard/mouse hooks, undo/redo with file-based state, color quantization algorithms, and cloud upload integration (Imgur, Yandex Disk). The codebase is well-structured but shows signs of technical debt: large monolithic files, legacy encoder implementations, deprecated SharpDX dependency, and minimal test coverage.
The LLM identified 5 files worth highlighting for reuse:
A generic WPF adorner that provides interactive resize, move, and rotate handles for any UIElement. It is self-contained, uses standard WPF adorners and visual hit-testing, and can be extracted into a separate library for reuse in any WPF application requiring drag-to-resize/move/rotate functionality.
Implements a Kohonen self-organizing map (neural network) algorithm for color quantization, reducing an image palette to 256 colors for GIF encoding. The algorithm is standalone, uses only System.Drawing.Bitmap, and demonstrates a non-obvious machine learning technique applied to image processing. It can be reused in any project requiring high-quality palette reduction.
Provides low-level global keyboard and mouse hooks via SetWindowsHookEx, with event-based callbacks for key presses, mouse moves, and clicks. The class encapsulates native P/Invoke calls and manages hook lifecycle (install/uninstall). It is a reusable component for any Windows application needing global input monitoring, with minimal dependencies on the rest of the codebase.
A custom GIF encoder that writes the GIF89a binary format, including header, logical screen descriptor, color tables, image data with LZW compression, and graphic control extensions. It supports multiple frames, transparency, and configurable delay. The encoder is self-contained and can be extracted as a standalone library for GIF generation without external dependencies.
A WPF custom control for integer input with up/down buttons, repeat behavior, and validation. It uses dependency properties for value, minimum, maximum, and step, and supports mouse wheel and keyboard interaction. The control is fully self-contained and can be reused in any WPF application requiring a numeric spinner.