-
Notifications
You must be signed in to change notification settings - Fork 69
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
Is it possible to compress png format images into jpeg or jpg formats? #91
Comments
Hi, actually no, the However, I am not sure if GPUJPEG would have any advantage for your scenario - if trying to recompress just a single image, there is plenty of tools that would do the job directly like ImageMagick. But if you have some specific reason to use GPUJPEG, I'd be glad to hear if you wish to share. |
I am very surprised to receive your reply so quickly, thank you.
|
I am afraid that re-encoding just a single image doesn't make much sense for a CUDA application like GPUJPEG (I don't know nvjpeg but I think it will be similar). I don't entirely know nvjpeg, but for GPUJPEG the main use case is to encode plenty of images in a batch, because there is an overhead with initialization of the library (CUDA etc), which needs to be amortized across multiple images. It really depends on your use case - I can imagine letting the transcoding application running and passing it the JPEG files during the time. But running the process for single image would perhaps perfom worse than encoding on a CPU.
Well, the code examples can be found here. For decoding PNG with libpng there are certainly code samples (or ChatGPT could also help). I could certainly make up an example including the PNG decode, but at this time I am unsure if there is some point (regarding my considerations above). On the command-line you can of course use a separate command to decode the PNG prior to encoding with GPUJPEG, eg.
But as indicated above, it won't have any performance benefits against converting directly to JPEG with the ImageMagick. Also, even if you could afford to encode multiple images, it seems to me that the bottleneck would be the PNG decompress, which is performed by CPU. |
Is it possible to compress png format images into jpeg or jpg formats?
I have a png wallpaper with a resolution of 8000*4113. I try to compress it. The console output is as follows
The text was updated successfully, but these errors were encountered: