Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Nicolas George via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Niklas Haas <ffmpeg@haasn.xyz>, Nicolas George <george@nsup.org>
Subject: [FFmpeg-devel] Re: [PATCH] lavfi: protection against premultiplied alpha (was: The patch series about premultiplied alpha)
Date: Tue, 2 Sep 2025 13:31:28 +0200
Message-ID: <aLbVkEaX3hWOYtWD@phare.normalesup.org> (raw)
In-Reply-To: <20250822171338.GB57262@haasn.xyz>

Sorry, it has been very busy weeks at work. I will have to be terse.

Niklas Haas via ffmpeg-devel (HE12025-08-22):
> Filters which do not touch the alpha channel, overwhelmingly either do not
> even care about the pixel contents, or produce their desired effect
> *regardless* of the colorspace.

I have already granted you that filters that do not consider pixel
values are not affected.

You have not acknowledged that they are a minority.

> What about frames in a perceptually uniform colorspace (like ICtCp)? Should
> we block filters from accepting anything by default except linear light
> floating point RGB?

If we want to do things properly, then yes, we should apply the same
care for these cases.

But you neglect that all these other color spaces preserve the
orthogonality between color and alpha. Only premultiplied alpha breaks
that.

> Dude, I understand the theory of colorspaces probably better than anybody
> else in this project.

Show, don't tell.

> The matter of fact is, that filtering in straight alpha actually overwhelmingly
> produces *wrong* results in practice.

This is a separate issue.

> I mean, if you see another filter that produces obviously broken results
> with premultiplied alpha, feel free to point it out, and I will probably
> get around to fixing it at some point. (Or fix it yourself - as you can see
> from the example of drawutils, the fix is usually trivial)

I can identify quite a few of them just by looking at the list.

“Fixing” them would be a waste of time.

> The fact that the blacklist is nonempty, obviously does not on its own
> constitute an argument for why a whitelist should therefore be the preferred
> solution.

The fact that the blacklist is still nonempty when you think you have
fixed everything is a proof that you are underestimating the problem.

What makes a whitelist the only acceptable solution is another reason,
though: the consequences of getting it wrong. If a filter is wrongly
assumed to work, it produces garbage that gets written to the output of
the users. If a filter is wrongly assumed to not work, the system will
just insert conversion filters and waste a few cycles.

One is unacceptable, the other is negligible. The default should be to
choose the issue with negligible drawbacks.

Regards,

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

      reply	other threads:[~2025-09-02 11:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-02 15:18 [FFmpeg-devel] The patch series about premultiplied alpha Nicolas George
2025-08-02 18:03 ` Nicolas George
2025-08-03 10:42   ` Niklas Haas
2025-08-03 10:50     ` Niklas Haas
2025-08-03 14:35     ` Nicolas George
2025-08-03 15:49       ` Nicolas George
2025-08-03 18:15         ` [FFmpeg-devel] [PATCH] lavfi: protection against premultiplied alpha (was: The patch series about premultiplied alpha) Nicolas George
2025-08-03 20:04           ` Michael Niedermayer
2025-08-03 20:50             ` Kacper Michajlow
2025-08-05  8:51           ` Niklas Haas
2025-08-05  8:58             ` Robert Nagy
2025-08-05  9:05             ` Nicolas George
2025-08-05  9:16               ` Nicolas George
2025-08-05  9:25                 ` Robert Nagy
2025-08-05  9:31                   ` Nicolas George
2025-08-05  9:31                     ` Robert Nagy
2025-08-11  9:18           ` Niklas Haas
2025-08-11  9:19             ` Niklas Haas
2025-08-11  9:32             ` Nicolas George
2025-08-13 14:25               ` Niklas Haas
2025-08-14 14:00                 ` Nicolas George
2025-08-20 21:43                   ` Niklas Haas via ffmpeg-devel
2025-08-20 21:44                     ` Niklas Haas via ffmpeg-devel
2025-08-22 13:47                       ` Nicolas George via ffmpeg-devel
2025-08-22 15:13                         ` Niklas Haas via ffmpeg-devel
2025-09-02 11:31                           ` Nicolas George via ffmpeg-devel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aLbVkEaX3hWOYtWD@phare.normalesup.org \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=ffmpeg@haasn.xyz \
    --cc=george@nsup.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git