c-koi/gmic-qt

recalculate filter only when switching or changing settings

Opened this issue · 2 comments

Please recalculate the filter only when switching or changing settings. From the QT window opened for a paint.net integration of gmic-qt, the filter is unnecessarily recomputed in all of these situations:

  • panning the preview image
  • right-clicking items in the filter list
  • selecting an option from the context menu that opens after right-clicking an item in the filter list
  • left-clicking the same filter that's currently selected

For both speed and preserving the current seed in cases where randomization is involved with a filter, it's best to avoids these unnecessary renders. Adding/removing the currently-selected filter from favs is probably another case.

Agree with most points, except "panning the preview image" that requires the preview to be recalculated.
The preview image is calculated only from the thumbnail it displays, not from the entire image (would take too much time for a preview, most of the time).

On preview image being recalculated, I think that is a fair point on it taking long. There is some filters that needs the whole image or at least some information from the whole image if possible (dimensions, or statistics). On just being able to get partial information, it would allow for accurate preview for some few filters.