Bug 395891 - New option in crop tool: crop only a current frame
Summary: New option in crop tool: crop only a current frame
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 4.1.0 beta
Platform: Other Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Emmet O'Neill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-26 12:57 UTC by Tiar
Modified: 2020-09-29 02:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2018-06-26 12:57:16 UTC
Crop tool, when applied to an animated layer, crop either the whole image or all frames on the layer.

Reproducible: always.

Steps to reproduce:
1. Create a new document, create two frames on a layer.
2. Paint things on both frames.
3. Being on one frame, crop it, using the "Layer" option in Tool Options.

Actual results:
4a. If the onion skin is tuned on, it initially looks as if only the current frame was cropped; but after selecting the other frame the view changes and then it looks like both/all frames are cropped.

Expected results:
4b. Option to choose if I want to crop the whole layer (with all frames) or just the frame.

The behaviour of cropping the whole layer is also a little inconsistent with the general idea that transforming tools (Move Tool, Transform Tool, Delete all content) works locally only on specific frame. Crop the whole layer/all frames is a nice feature, but crop the specific frame would be nice too.

Use case:
1. Easier cropping images from spritesheets (https://www.reddit.com/r/krita/comments/8ts8gq/animating_a_sprite_sheet/ as reference).
2. General transforming/cropping unnecessary data when animating, without the need to invert selection and deleting everything that way
Comment 1 Scott Petrovic 2019-04-14 00:41:22 UTC
I am not sure if cropping one frame makes sense. That would mean each layer could have multiple document sizes...depending on the frame. 

For the spritesheet example, there is already at least one workflow for doing that.
https://github.com/Falano/kritaSpritesheetManager

I am not sure if we want to go down the route of having different document sizes for each frame as a solution. That isn't really the purpose of the animation feature. This would probably need more discussion before anything might be done.
Comment 2 Tiar 2019-04-14 10:26:25 UTC
There are two options in Crop Tool now: crop a layer or crop a canvas (+ all content on all layers round the boundaries of the new canvas size). The first option doesn't change the document/canvas size. I want the first option, just applied to only one frame instead of all frames on the layer.
Comment 3 Scott Petrovic 2019-04-14 11:54:34 UTC
Ahh ok. It is in the tool options for the Crop tool. The section is called "Applies to". I think that is what you are referring to.

I think that makes sense then. Yes, I think that would make this a bug. Cropping with "applies to layer" should only affect the current animation frame selected, not all frames for the layer.
Comment 4 Tiar 2019-04-14 18:48:06 UTC
I was thinking about it as a wish: I would like to have both options, not only one (no matter which one it is). For example, cropping the layer as a whole could help if you want to get rid of the content outside of the canvas (there is never too much of RAM in animation), or if you want to cut something out from every frame on the layer. It's already implemented, so unless you can't easily have both options, removing it doesn't make sense.

TL;DR: I would like to be able to choose between Canvas, Frame and Layer in "Applies" area.
Comment 5 Emmet O'Neill 2020-09-29 02:56:06 UTC
Git commit 6931dae16cf9461951a459bb7e85b5c60e3f8763 by Emmet O'Neill.
Committed on 29/09/2020 at 02:55.
Pushed by emmetoneill into branch 'master'.

Crop Tool: "Frame" crop type option.

Added a new option to the crop tool that allows for cropping only
the contents of the active animation frame of the active layer.

M  +10   -3    libs/image/kis_image.cc
M  +2    -1    libs/image/kis_image.h
M  +8    -7    plugins/tools/tool_crop/kis_tool_crop.cc
M  +3    -1    plugins/tools/tool_crop/kis_tool_crop.h
M  +9    -4    plugins/tools/tool_crop/wdg_tool_crop.ui

https://invent.kde.org/graphics/krita/commit/6931dae16cf9461951a459bb7e85b5c60e3f8763