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

Write function doesn't take into account quality #21

Open
manuelporta opened this issue Mar 4, 2024 · 0 comments
Open

Write function doesn't take into account quality #21

manuelporta opened this issue Mar 4, 2024 · 0 comments

Comments

@manuelporta
Copy link

Hello there!
I'm trying to do some speed tests writting encoded images to disk playing with jpeg quality factor.
I'm using the python wrapper for NvJpeg_write as follows:

foo = nj.write('test.jpg', raw, quality)
print(foo)

I have tried with quality = [10, 70, 90] but I'm always obtaining the same buffer/file size (217936 for my case)

Regardless, when I directly use the NvJpeg_encode wrapper I achieve to get the proper sizes:

bar = nj.encode(raw, quality)
print(len(bar))
# 53096 for quality=10, 217936 for quality=70 and 447357 for quality=95

I've looked at the source code and it seems that NvJpeg_write just calls NvJpeg_encode and passes the arguments, but I'm not used at all to C code, so I'm probably missing out something.

Can anyone lend me a hand?

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

1 participant