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

Frames from video exported to lossless PNG #17

Open
Johnreidsilver opened this issue Aug 10, 2020 · 5 comments
Open

Frames from video exported to lossless PNG #17

Johnreidsilver opened this issue Aug 10, 2020 · 5 comments

Comments

@Johnreidsilver
Copy link

I was wondering if the program can improve frames from low resolution video. I exported the frames to PNG (lossless) but since they are not accepted by the program I converted to JPEG Q=100 (still not a lossless step). I ran the program with max quality, -q 6, but there's no difference between frames.

So I'm guessing the program needs an "original" JPEG file and won't work with frames exported from video even though they have JPEG like compression artifacts.

@zvezdochiot
Copy link

No, jpeg-quantsmooth works with jpeg quantization factors that your video does not have. For PNG, use https://github.com/ilyakurdyukov/gravityblur.

@ilyakurdyukov
Copy link
Owner

Only if it's an MJPEG video (each video frame can be extracted as a JPEG image), because this program is focused on the JPEG format. Same algorithm be done for some video codecs that also use DCT, but this will require a lot of work (e.g. researching a specific codec).

@ilyakurdyukov
Copy link
Owner

ilyakurdyukov commented Aug 10, 2020

I'll explain your results about an image saved in JPEG format at 100% quality - a certain percentage of quality is converted into a quantization table (which may be specific to the JPEG encoder), which is saved in the JPEG file (not the percentage itself). This table is also used by Quant Smooth to determine which parts of the image are artifacts and which are not. At 100% quality, there are no JPEG compression artifacts, because this is the original image passed to the encoder, your image had artifacts before JPEG.

And if someone just resaves low quality with higher quality - Quant Smooth will not be able to remove all artifacts, because the original quantization tables from the first compression in JPEG are lost. You can save the image as a JPEG with a quality that matches the quality of your video (but it's hard to guess what percentage is corresponds to), and then with Quant Smooth you will get some filtering, but this is a misuse of the program and will be inaccurate.

Similar programs listed in the comparison work the same way.

Hopefully this will help you understand how this works.

@zvezdochiot
Copy link

zvezdochiot commented Aug 10, 2020

Hi @ilyakurdyukov .

Gradually the thought matured: Add custom_quality option and use it to generate the quantization matrix, not use internal one.

PS: It would be an interesting move.

@DavidBuchanan314
Copy link

Gradually the thought matured: Add custom_quality option and use it to generate the quantization matrix, not use internal one.

Firstly, there's no prescribed way to convert a percentage into a QM. Secondly, if you used a different QM to the one stored in the image, you'd get meaningless results.

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

4 participants