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

why lossly compression performance worse than jpeg when compress png? #1393

Closed
jiuzhuanzhuan opened this issue Dec 11, 2021 · 1 comment
Closed

Comments

@jiuzhuanzhuan
Copy link

When i compress 24 Kodak pics ,compression ratio even worse than jpeg.
Below is my compression process,

  1. convert png to raw by numpy
  2. use opj_compress opj_decompress(version==openjpeg-v2.4.0-linux-x86_64)
import numpy as np
from PIL import Image
img = np.array(Image.open('kodim01.png'), np.uint8).tofile('kodim01.raw')
opj_compress -i kodim01.raw -F 512,768,3,8,u -I -r 5  -o kodim01.j2k # set r from 5 to 40
opj_decompres -i kodim01.j2k -o kodim01_recon.raw

When compareed the R-D performance whith JPEG, openjpeg is worse
image
(bpp means average bits of pixel of 24 Kodak pics, psnr means average Peak Signal to Noise Ratio of 24 Kodak pics).
So, how to set parameters when lossly compress image with public openjpeg executable correrctly?

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
@jiuzhuanzhuan and others