Skip to content

Commit

Permalink
Fixed --keep_invisible defaults. (#3562)
Browse files Browse the repository at this point in the history
  • Loading branch information
zond committed May 7, 2024
1 parent 663cb5f commit 661fec1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/jxl/enc_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ Status ComputeEncodingData(
bool lossless = cparams.IsLossless();
if (alpha && !alpha_eci->alpha_associated &&
frame_header.frame_type == FrameType::kRegularFrame &&
!ApplyOverride(cparams.keep_invisible, true) &&
!ApplyOverride(cparams.keep_invisible, cparams.IsLossless()) &&
cparams.ec_resampling == cparams.resampling &&
!cparams.disable_percepeptual_optimizations) {
// simplify invisible pixels
Expand Down
10 changes: 2 additions & 8 deletions lib/jxl/jxl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,9 @@ JXL_X86_64_TEST(JxlTest, RoundtripLargeEmptyModular) {
cparams.AddOption(JXL_ENC_FRAME_SETTING_DECODING_SPEED, 2);

PackedPixelFile ppf_out;
EXPECT_NEAR(Roundtrip(t.ppf(), cparams, {}, pool.get(), &ppf_out), 3474795,
EXPECT_NEAR(Roundtrip(t.ppf(), cparams, {}, pool.get(), &ppf_out), 669009,
100000);
EXPECT_SLIGHTLY_BELOW(ComputeDistance2(t.ppf(), ppf_out),
#if JXL_HIGH_PRECISION
2050
#else
12100
#endif
);
EXPECT_SLIGHTLY_BELOW(ButteraugliDistance(t.ppf(), ppf_out), 0.19);
}

TEST(JxlTest, RoundtripOutputColorSpace) {
Expand Down

0 comments on commit 661fec1

Please sign in to comment.