Skip to content
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

Squared artefacts on image when converting to AVIF #2662

Closed
vatsaljrathod opened this issue Feb 3, 2021 · 5 comments · Fixed by #2758
Closed

Squared artefacts on image when converting to AVIF #2662

vatsaljrathod opened this issue Feb 3, 2021 · 5 comments · Fixed by #2758
Labels

Comments

@vatsaljrathod
Copy link

Getting square artefacts at the right edge of the image while converting jpg to avif using av1 compression. Adding some example it might be useful.

Already checked with libheif, as per them bug should be in encoding application. One observation is, if we scale down speed setting then we are not getting these artefacts.

squared_artefacts_samples.zip

@adityapatadia
Copy link

I should mention that this issue only comes with version 0.4.0. Everything works fine with 0.3.4.

@lu-zero lu-zero added the bug label Feb 3, 2021
@lu-zero
Copy link
Collaborator

lu-zero commented Feb 3, 2021

Could you please provide more information on how you produced the file?

@adityapatadia
Copy link

It was produces using https://github.com/strukturag/libheif library. That library was in turn used inside https://github.com/lovell/sharp to generate image.

When we downgraded Rav1e, the issue went away hence reported here.

@lu-zero
Copy link
Collaborator

lu-zero commented Feb 4, 2021

If you can provide the settings in use and, even better a command line, it would be great.

@vatsaljrathod
Copy link
Author

Apologies for the delayed response.

Here is the setting I have used. Here speed >5 is causing the issue.
sharp: 0.27.0
libvips: 8.10.5
libheif: 1.10.0

let image = await sharp(inputImage)

  let resizeOptions = {
    kernel: 'lanczos3',
    fastShrinkOnLoad: true,
    width: 388,
    height: null,
    withoutEnlargement: true,
    fit: 'inside'
  };

  let heifOptions = {
    quality: 60,
    compression: 'av1',
    lossless: false,
    speed: 8
  }

  let imageBuffer = await image
    .rotate()
    .resize(resizeOptions)
    .sharpen()
    .heif(heifOptions)
    .toBuffer({resolveWithObject: true});

barrbrain added a commit to barrbrain/rav1e that referenced this issue Jul 8, 2021
The input stride for forward transforms did not match the output
stride of residual computation in this case. Extend the residual
stride to the transform width and zero the non-visible portion.
Fixes xiph#2662. Fixes xiph#2757.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants