Skip to content

oiiotool --repremult #3192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/oiiotool/oiiotool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3047,7 +3047,8 @@ BINARY_IMAGE_COLOR_OP(powc, ImageBufAlgo::pow, 1.0f); // --powc

UNARY_IMAGE_OP(abs, ImageBufAlgo::abs); // --abs

UNARY_IMAGE_OP(premult, ImageBufAlgo::premult); // --premult
UNARY_IMAGE_OP(premult, ImageBufAlgo::premult); // --premult
UNARY_IMAGE_OP(repremult, ImageBufAlgo::repremult); // --repremult

// --unpremult
OIIOTOOL_OP(unpremult, 1, [](OiiotoolOp& op, span<ImageBuf*> img) {
Expand Down Expand Up @@ -6180,6 +6181,9 @@ getargs(int argc, char* argv[])
ap.arg("--premult")
.help("Multiply all color channels of the current image by the alpha")
.action(action_premult);
ap.arg("--repremult")
.help("Multiply all color channels of the current image by the alpha, but don't crush alpha=0 pixels to black.")
.action(action_repremult);
// clang-format on

if (ap.parse_args(argc, (const char**)argv) < 0) {
Expand Down