Inverting colors overwrites transparency with white pixels

Bug #602651 reported by Maia Everett on 2010-07-07
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Pinta
Medium
Unassigned

Bug Description

To reproduce:

1. Create a transparent layer.
2. Draw something on it.
3. Select Adjustments -> Invert colors.

Expected result: non-transparent pixels are inverted, while transparent pixels stay the same.
Actual result: non-transparent pixels are inverted, and transparent pixels are replaced with white ones.

Maia Everett (linneris) wrote :

Apparently this bug occurs *only* if there is another layer underneath the selected layer, *and* it is visible.

Jonathan Pobst (jpobst) wrote :

Grr, I used to know how to reproduce this one, and now I can't remember how to do it anymore.

Jonathan Pobst (jpobst) on 2010-12-14
Changed in pinta:
importance: Undecided → Medium
Jonathan Pobst (jpobst) wrote :

In case I forget again:
- New Image
- Fill to gray
- Create new layer
- Draw black line with paintbrush on new layer
- Invert colors on new layer

Robert Nordan (rpvn) wrote :

It doesn't seem to be related to the actual inversion method, since the pixel operation is very straightforward and is applied the same no matter if there is a visible layer beneath it or not. Also worth noting is that the image preview in the layer list and open images list will have transparent pixels turned white even if they're still transparent on canvas. (Even if you only have a single layer.)

This leads me to believe that something is wrong with how layers report their colours to tools other than the canvas. The reason all the transparent pixels are turned white is because the inversion tool is being told they're black (while the canvas has been correctly told they're transparent), and then subsequently orders all the pixels changed to white which is then passed on to the canvas.

Changed in pinta:
status: New → Confirmed
Robert Nordan (rpvn) wrote :

Ok, did some further investigating on this a while back but forgot to post the notes on what I managed to dig up:

The inversion method is being given the correct values, and therefore is inverting them correctly as well. Does the problem lie in how the changed values are handed back to the canvas?

The layer widget pulls layer.Surface directly (rather than the way the inversion method extracts point values) and also displays it wrong, so there must be something gone wrong with the actual layer's surface.

Probably caused by canvas not concatenating/compositing colours properly in some way, specifically when there isn't a background colour taking precedence.

There is a minor possiblity that Cairo or Mono.Cairo is messing something up, but I can't say that for sure.

Cameron White (cameronwhite91) wrote :

I'm only seeing this issue on Ubuntu (works fine on Windows 7) - is that the case for everyone else?

Cameron White (cameronwhite91) wrote :

Turns out this was fixed during the work on layer blend modes (https://github.com/PintaProject/Pinta/pull/17)

Changed in pinta:
milestone: none → 1.4
status: Confirmed → Fix Committed
Robert Nordan (rpvn) on 2012-05-01
Changed in pinta:
status: Fix Committed → Fix Released
Cameron White (cameronwhite91) wrote :

Moving back to Fix Committed (this was done after Pinta 1.3 was released).

Changed in pinta:
status: Fix Released → Fix Committed
grofaty (grofaty) on 2012-09-27
Changed in pinta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers