pencil tool with 0 opacity has no effect

Bug #1688743 reported by Tom Daffin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
Undecided
Unassigned

Bug Description

If I middle click to create a color with 0 opacity then trying to use that color with the pencil tool has no effect.

This works fine though if you use the paint bucket, but I need it to work with the pencil tool for changing single pixels without also changing other connected pixels of the same color.

As I recall this didn't work right out of the box with paint.net either, but you can get this working on paint.net by changing something like 'composition mode' from something like 'blend' to 'overwrite'.

Revision history for this message
Tom Daffin (tdaffin) wrote :

I've started to look at the source for this, and it appears that perhaps the bug is actually that the paint bucket tool is not honoring the blend settings under the hood.

PaintBucketTool does not use UserBlendOps.NormalBlendOp.ApplyStatic to combine with the existing color, so just overwrites what is there using ColorBgra.ToPremultipliedAlpha.

I guess what really needs to happen is the addition of a new 'OverwriteBlendOp' and the exposure of the blendop being used in the gui, in a similar way to Paint.net

Revision history for this message
Cameron White (cameronwhite91) wrote :

Yeah, adding a new blend mode that maps to Operator.Source, and then adding a blend mode parameter to the tool, sounds like a good approach.

Revision history for this message
Tom Daffin (tdaffin) wrote :

I'll see if I can find the time to look at this over the weekend.

For the record I've taken a screen shot of the 'blend mode' drop down that is available on the pencil tool in paint.net 4.0.13 on windows and attached it to this comment.

Revision history for this message
Tom Daffin (tdaffin) wrote :

Also attached is a screenshot of the layer blend modes from 4.0.13.
It is worth noting that the 'Overwrite' option that is available in the pencil blend modes is not available in the layer blend modes.

Revision history for this message
Tom Daffin (tdaffin) wrote :

One last note -- in paint.net 4.0.13 the full list of tools that include the 'Blending mode' drop down (I incorrectly referred to it as 'blend mode' in an earlier comment) are:
Paint Bucket, Paintbrush, Pencil, Gradient, Clone Stamp, Text, Line/Curve and Shapes
Probably any fix to the pencil tool should include a blending mode control that can be easily re-used in the other tools.
Also worth noting is that if you change the blending mode in one tool and then switch to another that honors it then the change you made is carried over to the new tool.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Yeah, I guess the overwrite blend mode probably isn't too useful for layers, but I don't object to having it there if it makes the implementation simpler.

Revision history for this message
Tom Daffin (tdaffin) wrote :

It appears that there is already a ToolBarDropDownButton available in Pinta.Core/Classes/BaseTool, but its implementation isn't quite complete.
It only has two options -- Normal or Overwrite, which as I recall is all there is in Paint.net 3.x which Pinta is based on anyway.

I've been able to get it to appear in the GUI and add the code to support it in Pencil tool, so I think I'll be able to get a merge request together this weekend.

Revision history for this message
Tom Daffin (tdaffin) wrote :

Posted a pull request: https://github.com/PintaProject/Pinta/pull/124

I thought about adding the drop down to all the other tools that can use it, but I figured I'd keep my first pull request simple.

Revision history for this message
Cameron White (cameronwhite91) wrote :
Changed in pinta:
milestone: none → 1.7
status: New → Fix Committed
grofaty (grofaty)
Changed in pinta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.