private async void UpdateImage()
        {
            var diff = _optimizer.ColorsCount - numericUpDown1.Value.ToInt();

            if (diff > 0)
            {
                _optimizer.Progress.ProgressChanged += Progress_ProgressChanged;
                GUIDisable();
                await _optimizer.DeleteColorsAsync(diff);

                _optimizer.Progress.ProgressChanged -= Progress_ProgressChanged;
                GUIReady();
                _area.Redraw();
            }
            else if (diff < 0)
            {
                _optimizer.Progress.ProgressChanged += Progress_ProgressChanged;
                GUIDisable();
                await _optimizer.RestoreColorsAsync(-diff);

                _optimizer.Progress.ProgressChanged -= Progress_ProgressChanged;
                GUIReady();
                _area.Redraw();
            }
        }