Skip to content

Fixed curves changing the alpha value of transparent images (#2242) - #2393

Open
Diver202 wants to merge 2 commits into
PintaProject:masterfrom
Diver202:fix/curves_transparency
Open

Diver202 wants to merge 2 commits into
PintaProject:masterfrom
Diver202:fix/curves_transparency

Conversation

@Diver202

Copy link
Copy Markdown

Description of Changes

In Luminosity mode, raising the left end of the curve made transparent areas turn opaque. This was because the adjustment added the luminosity difference straight onto the premultiplied B/G/R channels.

LuminosityCurve.Apply now handles alpha explicitly:

  • Fully transparent (A == 0): returns unchanged.
  • Fully opaque (A == 255): the curve is applied directly.
  • Semi-transparent: the pixel is converted to straight alpha, the curve is applied, and the pixel is converted back to premultiplied.

The curve logic moved into a private ApplyStraight helper. It always works on straight-alpha values and keeps the original alpha.

Fixes #2242

Here are the videos showing the difference:
Before:

Test.png.-.Pinta.2026-11-15.18-51-59.mp4

After:

Video.Project.22.mp4

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Curve tool removes transparency from image when highering first handle macOS M2

1 participant