Bug 402443 - Enlarging a canvas paint added sections instead of keeping them transparent
Summary: Enlarging a canvas paint added sections instead of keeping them transparent
Status: RESOLVED NOT A BUG
Alias: None
Product: krita
Classification: Applications
Component: Resize/Scale Image/Layer (show other bugs)
Version: 4.1.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-21 21:18 UTC by SkyDiver
Modified: 2018-12-29 12:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SkyDiver 2018-12-21 21:18:59 UTC
My original scenario started with opening a .jpg image, but it's enough to create a new document for reproducing the issue.

STEPS TO REPRODUCE
1. Open Krita and create a new document (should have a white background)
2. Draw a black circle at the middle of the document
3. Select the Contiguous Selection Tool > fuzziness = 1
4. Click outside the circle to select all the outer white material
5. Press DEL to make the white area transparent
6. Image > Resize Canvas: enlarge width/height/both (e.g. by 50%)

OBSERVED RESULT
The enlarged space is painted white.

EXPECTED RESULT
The enlarged space should be transparent.


NOTES
1. Saving the document as a .kra file, relaunching and retesting preserves the problem.
2. Duplicating the layer (CTRL+J) preserves the problem.
3. It seems that the layer "remembers" that it's some sort of a "background layer" thus painting new area instead of keeping them white.
4. The following workaround fixes the problem
4.1. Make sure the layer is selected
4.2. Select > Select All
4.3. Edit > Paste
4.4. Remove/hide the old layer
4.5. Enlarge the canvas.
4.6. The enlarges space remains transparent.


SOFTWARE/OS VERSIONS
Krita
  Version: 4.1.5

Qt
  Version (compiled): 5.9.5
  Version (loaded): 5.9.5

OS Information
  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.15.0-42-generic
  Pretty Productname: Ubuntu 18.04.1 LTS
  Product Type: ubuntu
  Product Version: 18.04

OpenGL Info
  **OpenGL not initialized**
Comment 1 mvowada 2018-12-22 08:41:35 UTC
Hi Sky, 
can you say what happens if you do right-click over the layer > select "Properties..." and low the layer opacity down to 0%?

Example:

    1. fresh configs
    2. "CTRL+N" (default settings)
    3. click select the bottom layer
    4. "CTRL+A" (select all)
    5. "CTRL+X" (cut)
    6. Image > Resize Canvas... (enlarging)
    7. right-click over the layer > "Properties..." > Opacity: 0%. 

Actual Results: transparent margins. 

Is it the same for you? Thanks.
Comment 2 SkyDiver 2018-12-23 20:10:55 UTC
Hi mvowada,

To make sure we're on the same page, you asked me to create a new blank document (CTRL+N), select everything, delete the content such that the whole canvas becomes transparent (I use the DEL key, but CTRL+X has the same effect), then enlarge the canvas, see that there are white margins all around, then lower that (single) layer's opacity to 0% (not sure what you meant by bottom layer - there's only one layer).

If the above is what you meant, then yes - the margins become transparent.

I'd just like to emphasize that doing this will make all the pixels on that layer become transparent, including the ones that I'd like to keep visible.
This is, of course, not the desired end-result.
Comment 3 mvowada 2018-12-24 10:57:59 UTC
(In reply to SkyDiver from comment #2)
> I'd just like to emphasize that doing this will make all the pixels on that
> layer become transparent, including the ones that I'd like to keep visible.

I see the point. It's always possible to change the default canvas transparency by going to "CTRL+N" > "Create new document" > "Content" tab.
Comment 4 SkyDiver 2018-12-26 16:03:38 UTC
(In reply to mvowada from comment #3)
> It's always possible to change the default canvas
> transparency by going to "CTRL+N" > "Create new document" > "Content" tab.
Nice! I was not aware of that.

Beyond solving the issue for new images, it turns out that this becomes the default behavior for existing images as well.
Meaning that after setting the content opacity to 0%, when I enlarge the canvas of an existing image, the enlarged area is transparent.

In light of this new information, this doesn't seem to be a bug, rather a different default background value than what got used to from other image-manipulation software.

My guess is that you wouldn't be keen on changing the system's default behavior, but still I'm passing the ticket to you to decide whether to close it or not.

Thank you!
Comment 5 mvowada 2018-12-29 12:12:20 UTC
Sky, thanks for reporting back. I'm going to close this report. Feel free to reopen it in case.