Bug 363153 - rounding errors when using burn on floating point images cause artefacts
Summary: rounding errors when using burn on floating point images cause artefacts
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Filter Layers (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL: http://i.imgur.com/jm68WIZ.jpg
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-16 23:37 UTC by Lake
Modified: 2024-12-12 14:08 UTC (History)
3 users (show)

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


Attachments
The buggy file (1.01 MB, application/x-krita)
2016-05-21 21:52 UTC, Lake
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lake 2016-05-16 23:37:46 UTC
I made a couple layers for shadowing - the highlighted one being set to the layer mode of "burn". After, I noticed strange, thick, uniformly medium-dark grey artifacts around the building I had been working on, that only seemed to show up where the sky was going to go (an area I had not yet painted and as such it was the only area still the bright white of the bottom layer). I tried multiple times to erase it: it's color lightened on every first try very slightly, but it always reverted back to the same medium-dark grey color. Soon after, the Krita window lost focus and Krita crashed.

The strange line artifacts are on the screen are from the vanishing line assistants (three, set to invisible), which always creates artifacts for me (I can't use OpenGL). In past versions of Krita, using the vanishing lines was a pretty reliable way to crash the program quickly (crashed within seconds/minutes about 75% of the time), but I don't know that it ever created these artifacts.

Using Windows 7.

Problem signature:
  Problem Event Name:	BEX
  Application Name:	krita.exe
  Application Version:	0.0.0.0
  Application Timestamp:	56b086c6
  Fault Module Name:	CSRBthFtpShellExt.dll_unloaded
  Fault Module Version:	0.0.0.0
  Fault Module Timestamp:	4a44958d
  Exception Offset:	5effdda7
  Exception Code:	c0000005
  Exception Data:	00000008
  OS Version:	6.1.7601.2.1.0.256.48
  Locale ID:	1033
  Additional Information 1:	fa66
  Additional Information 2:	fa6696398de2b9f98383d7a3bf5c3ea1
  Additional Information 3:	fa66
  Additional Information 4:	fa6696398de2b9f98383d7a3bf5c3ea1

Thank you for your time and effort.

Reproducible: Didn't try
Comment 1 Lake 2016-05-16 23:41:04 UTC
I should also note that, on re-opening the file after the crash, the grey artifacts remain and refuse to be erased (including with the selection tool + clear command).
Comment 2 Halla Rempt 2016-05-17 06:40:06 UTC
Hi,

Thanks for your report. We're busy with the final stages of release Krita 3.0, where a lot of the layer stack computation was rewritten. Could you please test with the most recent beta build whether you can still reproduce both issues?
Comment 3 Lake 2016-05-21 21:52:24 UTC
Created attachment 99126 [details]
The buggy file

Hello,

I installed the 3.0 beta and opened the file. It is still messed up, but on playing with it, I noticed some interesting behavior:

Painting over the buggy area of the canvas (even on a different layer as long as it is either the glitched layer or above it) is fine as long as you are painting at 100% opacity - if it is anything less, the area will remain untouched.

If you paint over the area with 100% opacity, you can then paint over it with any opacity - but if you erase the area, the bug will return.

If the Layer is set to anything less than 100% opacity, the buggy area will remain buggy (or become buggy) no matter what opacity the brush is set to. But setting it to 100% will cause any 100% opaque to suddenly be recalculated "correctly".

I also managed to paint over the buggy area with red and then erase over top of it, removing all the paint *except* the paint in the bugged area. I was able to do this repeatedly, but it was a few hours ago and I have since re-booted Krita and forgot how I managed to do it.

I have attached a copy of the file, so you may play around with it, if you would like.

Good luck!
Comment 4 Halla Rempt 2016-05-26 06:57:15 UTC
Hm, looking at the file I see that it's a 16 bit float/channel file -- and I suspect that we're dealing with some rounding errors here.
Comment 5 Halla Rempt 2016-06-16 12:58:45 UTC
Confirming
Comment 6 Halla Rempt 2016-10-31 15:10:14 UTC
No longer a crash.
Comment 7 Robert Moerland 2024-11-22 21:22:14 UTC
Reconfirmed on Windows with version 5.3.0-alpha (3138bbd1) and 5.2.6
Comment 8 Dmitry Kazakov 2024-11-26 10:37:45 UTC
The reason why the bug happens is that the color values become negative :)
Comment 9 Dmitry Kazakov 2024-12-12 14:08:10 UTC
This MR fixed the issue: https://invent.kde.org/graphics/krita/-/merge_requests/2294 :)