Pinta icon indicating copy to clipboard operation
Pinta copied to clipboard

Add feather effect

Open potatoes1286 opened this issue 1 year ago • 5 comments

Fixes #886

Adds feather tool to Effects > Stylize (Considered blur, but I think this is more fitting). This softens the edges of an image without spilling blur out of the image or blurring the contents of the image.

Radius adjusts the strength of the effect, Transparency Threshold is used to determine the "outline" of the object. Requires object be surrounded by transparency to function.

Example with a test image.

feather effect with test image

Only known issue I am aware of is that the effect will spill over outside selection in preview, however it does not spill over after application. Unsure how to fix this.

potatoes1286 avatar Aug 23 '24 02:08 potatoes1286

One other note is that you can also add tests for the effect in https://github.com/PintaProject/Pinta/blob/master/tests/Pinta.Effects.Tests/EffectsTest.cs

cameronwhite avatar Aug 25 '24 14:08 cameronwhite

One other note is that you can also add tests for the effect in https://github.com/PintaProject/Pinta/blob/master/tests/Pinta.Effects.Tests/EffectsTest.cs

I can, but because feather replies on transparency, the output is identical to the test input image.

potatoes1286 avatar Aug 27 '24 01:08 potatoes1286

One other note is that you can also add tests for the effect in https://github.com/PintaProject/Pinta/blob/master/tests/Pinta.Effects.Tests/EffectsTest.cs

I can, but because feather replies on transparency, the output is identical to the test input image.

Right, good point :) Feel free to adjust that TestEffect method to let you choose a different input image if that works

cameronwhite avatar Aug 28 '24 02:08 cameronwhite

Should be good now.

potatoes1286 avatar Aug 28 '24 22:08 potatoes1286

Implemented feedback. Should be thread safe now. While I did implement ISystemService, I am not very familiar with DI so do correct me if I messed up a part of it. I said I was avoiding working by-pixel instead of by-border pixel for performance reasons, but I feel like the new code is more responsive. (Guesswork. Haven't measured it.)

potatoes1286 avatar Aug 31 '24 04:08 potatoes1286

Looks good, thanks for your contribution!

cameronwhite avatar Sep 02 '24 15:09 cameronwhite