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

JPEG to AVIF conversion outputs black image #264

Closed
adityapatadia opened this issue Jul 29, 2020 · 20 comments
Closed

JPEG to AVIF conversion outputs black image #264

adityapatadia opened this issue Jul 29, 2020 · 20 comments

Comments

@adityapatadia
Copy link
Contributor

adityapatadia commented Jul 29, 2020

I have tried converting this image with following command
https://demo.gumlet.io/sea.jpeg

heif-enc sea.jpeg -A -o sea.avif

It gives black image output. I have compiled latest version of libheif along with 2.0 version of libaom.

@adityapatadia
Copy link
Contributor Author

I should mention that HEIF output works fine. The issue happens only with AVIF.

@farindk
Copy link
Contributor

farindk commented Jul 29, 2020

What is 'latest version' ? v1.7.0, top of 'master' branch, top of 'develop' branch?

I see nothing special about that file. It encodes well for me.
A completely black output also seems strange to me. I have no idea how that could happen.
I'll need more specific information to reproduce this.

@adityapatadia
Copy link
Contributor Author

adityapatadia commented Jul 29, 2020

I used 1.7.0 of libheif. I also used 2.0.0 version of libaom.

@adityapatadia
Copy link
Contributor Author

I am ready to provide any information you need.

@adityapatadia
Copy link
Contributor Author

adityapatadia commented Jul 29, 2020

This is my output file.
sea.avif.zip

@farindk
Copy link
Contributor

farindk commented Jul 29, 2020

Your output looks fine. This is the JPEG when I decode it back with
heif-convert ~/sea.avif sea-decoded.jpg

The only problem is the padding at the bottom border. Maybe your image viewer cannot handle AVIF or it is confused by this padding issue.

sea-decoded

@adityapatadia
Copy link
Contributor Author

adityapatadia commented Jul 29, 2020

What is the reason for the padding at bottom? It's not there in original image.

Maybe your image viewer cannot handle AVIF or it is confused by this padding issue.

My image viewer is Chrome 85 Bata which has added support for AVIF images in desktop version.

@adityapatadia
Copy link
Contributor Author

Images like this open perfectly fine in Chrome 85 Beta: https://github.com/link-u/avif-sample-images/blob/master/kimono.avif

@farindk
Copy link
Contributor

farindk commented Jul 29, 2020

The padding issue is a bug / missing features (see #232). We're working on it.

@adityapatadia
Copy link
Contributor Author

Do you mean if I output height is multiple of 8, it will be resolved?

@adityapatadia
Copy link
Contributor Author

Okay, that is correct. I cropped image 800x800 and then converted it. It shows perfectly fine in Chrome 85. I will be waiting for the bug fix.

@farindk
Copy link
Contributor

farindk commented Jul 29, 2020

Thanks, it is good to know that the padding is the reason for this behavior.
I'll close this issue as it appears to be in fact a duplicate of #232.

@farindk farindk closed this as completed Jul 29, 2020
@adityapatadia
Copy link
Contributor Author

This issue is still not resolved. Please check the image produced by master branch.
sea.avif.zip

@farindk
Copy link
Contributor

farindk commented Aug 3, 2020

Hm, when I encode that image (input size 713x476) with current libheif (436d1c4), master branch, the image shows correctly in Chroma 85 beta (Linux). Image attached.
sea-small.zip

@farindk farindk reopened this Aug 3, 2020
@adityapatadia
Copy link
Contributor Author

I have checked with 0c49d5b and it seems to be working perfectly fine.

@farindk
Copy link
Contributor

farindk commented Aug 4, 2020

Thanks for testing again. Can we close the issue?

@adityapatadia
Copy link
Contributor Author

Yes, let's close it. Just one more suggestion. Libaom 2.0 also seems slow so I would appreciate if you write a detailed description on how to work with rav1e.

@farindk
Copy link
Contributor

farindk commented Aug 4, 2020

Since there are no rav1e packages yet, you have to compile rav1e inside the source tree (see the README). Then, you have to use cmake for compilation, I have not integrated rav1e into the automake scripts yet (#266).

@farindk farindk closed this as completed Aug 4, 2020
@adityapatadia
Copy link
Contributor Author

Readme states that there is third-party folder but I don't see any.

@farindk
Copy link
Contributor

farindk commented Aug 4, 2020

@adityapatadia Good point :-) I've just checked in the missing file...

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

No branches or pull requests

2 participants