Skip to content

feat(IBA): Add FLIP perceptual image difference metric#5154

Merged
lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
lgritz:lg-flip
Apr 29, 2026
Merged

feat(IBA): Add FLIP perceptual image difference metric#5154
lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
lgritz:lg-flip

Conversation

@lgritz
Copy link
Copy Markdown
Collaborator

@lgritz lgritz commented Apr 20, 2026

Implements the FLIP algorithm from Andersson et al. 2020, rewritten with OIIO idioms (no source code from the BSD-licensed reference FLIP.h is directly incorporated). Included are C++ and Python API for ImageBufAlgo::FLIP_diff(), and oiiotool --flipdiff command. The basic operation is to compare two images and produce a per-pixel error map that conveys perceptual difference to human observers.

I won't explain it all here; see the extensive comments in imagebufalgo.h, imagebufalgo_flip.cpp, oiiotool.cpp, imagebufalgo.rst, oiiotool.rst.

There are some important changes (especially for how we expose this via oiiotool) versus the way the original NVIDIA reference implementation's command line tool worked. Please read the extensive comments at the top of imagebufalgo_flip.cpp for details.

This is a preliminary, experimental implementation. It's hidden behind an experimental namespace (and the oiiotool command requires use of the --experimental argument) to emphasize that it may change and is not yet considered part of OIIO's public API, and thus is exempt from our usual strict rules about breaking backward compatibility. Try it out and give feedback, but do not rely on this yet!

Assisted-by: Claude Code / sonnet-4.6 + opus-4.6

I used Claude Code for the inital stab at transforming the NVIDIA reference implementation into OIIO idiomatic equivalents. But to be honest, that got me over the hump of the blank page, but I rewrote most of it bit by bit as I continued to refine my design ideas for how it should work and be exposed to users.

Implements the FLIP algorithm from Andersson et al. 2020, rewritten
with OIIO idioms (no source code from the BSD-licensed reference
FLIP.h is directly incorporated). Included are C++ and Python API for
ImageBufAlgo::FLIP_diff(), and `oiiotool --flipdiff` command.  The
basic operation is to compare two images and produce a per-pixel error
map that conveys perceptual difference to human observers.

I won't explain it all here; see the extensive comments in
imagebufalgo.h, imagebufalgo_flip.cpp, oiiotool.cpp, imagebufalgo.rst,
oiiotool.rst.

There are some important changes (especially for how we expose this
via oiiotool) versus the way the original NVIDIA reference
implementation's command line tool worked. Please read the extensive
comments at the top of imagebufalgo_flip.cpp for details.

This is a preliminary, experimental implementation. It's hidden behind
an `experimental` namespace (and the oiiotool command requires use of
the `--experimental` argument) to emphasize that it may change and is
not yet considered part of OIIO's public API, and thus is exempt from
our usual strict rules about breaking backward compatibility. Try it
out and give feedback, but do not rely on this yet!

Assisted-by: Claude Code / sonnet-4.6 + opus-4.6

I used Claude Code for the inital stab at transforming the NVIDIA
reference implementation into OIIO idiomatic equivalents. But to be
honest, that got me over the hump of the blank page, but I rewrote
most of it bit by bit as I continued to refine my design ideas for how
it should work and be exposed to users.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz
Copy link
Copy Markdown
Collaborator Author

lgritz commented Apr 25, 2026

Maybe @grdanny or @chellmuth can give this a review?

I know that the implementation is complex, but remember: (a) it is still in flux with many planned improvements, so there is no point over-scrutinizing code that is still changing; (b) the tests confirm that it matches the numerical results of the NVIDIA reference implementation, so we know it is correct. I'm more concerned with any big complaints you have about the APIs or overall design and vision of this feature, before we merge and let people start playing with it.

Copy link
Copy Markdown
Contributor

@chellmuth chellmuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a high level, looks pretty solid to me!

@lgritz
Copy link
Copy Markdown
Collaborator Author

lgritz commented Apr 29, 2026

I'm going to take that as an approval so we can merge. It's experimental and still under development, so if we spot anything later that we missed, fixes can be folded in with the subsequent PRs that will continue to advance this feature.

@lgritz lgritz merged commit 4001154 into AcademySoftwareFoundation:main Apr 29, 2026
65 checks passed
@lgritz lgritz deleted the lg-flip branch April 29, 2026 18:49
jessey-git pushed a commit that referenced this pull request Apr 29, 2026
PR #5154 crossed streams with another that turned on more warnings for
unchecked errors. The check isn't necessary here, though.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request May 1, 2026
…reFoundation#5154)

Implements the FLIP algorithm from Andersson et al. 2020, rewritten with
OIIO idioms (no source code from the BSD-licensed reference FLIP.h is
directly incorporated). Included are C++ and Python API for
ImageBufAlgo::FLIP_diff(), and `oiiotool --flipdiff` command. The basic
operation is to compare two images and produce a per-pixel error map
that conveys perceptual difference to human observers.

I won't explain it all here; see the extensive comments in
imagebufalgo.h, imagebufalgo_flip.cpp, oiiotool.cpp, imagebufalgo.rst,
oiiotool.rst.

There are some important changes (especially for how we expose this via
oiiotool) versus the way the original NVIDIA reference implementation's
command line tool worked. Please read the extensive comments at the top
of imagebufalgo_flip.cpp for details.

This is a preliminary, experimental implementation. It's hidden behind
an `experimental` namespace (and the oiiotool command requires use of
the `--experimental` argument) to emphasize that it may change and is
not yet considered part of OIIO's public API, and thus is exempt from
our usual strict rules about breaking backward compatibility. Try it out
and give feedback, but do not rely on this yet!

Assisted-by: Claude Code / sonnet-4.6 + opus-4.6

I used Claude Code for the inital stab at transforming the NVIDIA
reference implementation into OIIO idiomatic equivalents. But to be
honest, that got me over the hump of the blank page, but I rewrote most
of it bit by bit as I continued to refine my design ideas for how it
should work and be exposed to users.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request May 1, 2026
…tion#5171)

PR AcademySoftwareFoundation#5154 crossed streams with another that turned on more warnings for
unchecked errors. The check isn't necessary here, though.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
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.

2 participants