Skip to content

Write function doesn't take into account quality #21

@manuelporta

Description

@manuelporta

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions