Skip to content

Crop imported animation frames to content

Bip Boop requested to merge bipboop/krita:Crop_animation_frames_on_import into master

Crop the frames to content when importing images as animation frames. Speed up calculateExactBoundsImpl by skipping some of the already checked pixels to try to offset the many more calls to it.

When importing images as animation frames, it

  • Reduces file size
  • Reduces ram usage

Resolves #429294 https://bugs.kde.org/show_bug.cgi?id=429294

Test Plan Use the files provided in the bug report or

Create an animation, save the document, export it as an image sequence.

Then, use "Import animation frames..."to import the sequence of images in a new document, save the second document.

The saved file should be smaller and the document should use less ram than before.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports