HaikuArchives / ArtPaint

ArtPaint is a painting and image processing program.
https://haikuarchives.github.io/ArtPaint/
29 stars 18 forks source link

Transparency Tool: use slider instead of alpha from current color #509

Closed dsizzle closed 1 year ago

dsizzle commented 1 year ago

addresses transparency part of #176

humdingerb commented 1 year ago

Nice change. I see two noteworthy things.

  1. Using the tool on transparent parts of an image turns them black.
    • Put Ducky.png on layer 1
    • Put Walter.png on layer 2
    • Set tool to e.g. size:75 / transparency:60 / pressure:100
    • On layer2, draw over the logo into the transparent parts of Walter and Ducky:

1

Drawing on the transparent pixels of Walter appears dark, on Ducky it's bright. The lower your transparency slider setting, the starker the dark/bright. Is that expected?

  1. Low pressure never reaches 100% transparency
    • Set transparency:100 and pressure:10
    • Keep clicking on an area, it will never reach 100% transparency. Shouldn't it eventually?

2

dsizzle commented 1 year ago

Using the tool on transparent parts of an image turns them black.

the tool ONLY changes the alpha value and so it’ll always be some color. On Walter it must be that the transparent parts are RGBA = 0, 0, 0, 0 and on ducky they are 255, 255, 255, 0. Not sure anything can be done about it because the tool needs to be able to work on fully transparent colors just like any other color.

Low pressure never reaches 100% transparency

This is a bug. I think I introduced this by trying to slow down the pressure.

dsizzle commented 1 year ago

ok, the low-pressure-never-reaching-full-transparency-or-opacity has been fixed.

humdingerb commented 1 year ago

the tool ONLY changes the alpha value and so it’ll always be some color. On Walter it must be that the transparent parts are RGBA = 0, 0, 0, 0 and on ducky they are 255, 255, 255, 0. Not sure anything can be done about it because the tool needs to be able to work on fully transparent colors just like any other color.

I see, I haven't thought about it that way... That's problem of only having 0-255 available per channel, or a -1 could signal "no pixel". :)

Anyway, working now. Merge. Thanks!

dsizzle commented 1 year ago

The problem with the idea of a “non pixel” is that then for any operation you also need to decide whether to affect them or not. Also, how/when do you make a non pixel into a pixel and vice versa? It would complicate the code unnecessarily - the proper workflow is to use a selection to avoid affecting pixels you don’t want to affect.

humdingerb commented 1 year ago

Deep philosophical questions... To be a pixel, or non-pixel, that is the question. Where's my skull again...? :)