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

opj_compress with lossy compression results in strange pixel values #851

Closed
vroeyt opened this issue Sep 26, 2016 · 1 comment
Closed

opj_compress with lossy compression results in strange pixel values #851

vroeyt opened this issue Sep 26, 2016 · 1 comment
Labels

Comments

@vroeyt
Copy link

vroeyt commented Sep 26, 2016

When calling opj_compress with lossy compression enabled, I got output pixel values that are completely diffferent than the input pixels. I used the following command (in this case lossy compression with ratio 5):

opj_compress -I -r 5 -i test.tif -o test.jp2

For example, the pixel at position (0,0) in the original TIFF image "test.tif" has pixel value 97, while the corresponding pixel in the output jpeg2000 image "test.jp2" has value 62069. Once could expect that the compressed pixel values are slightly different than the original pixel values, but such a huge difference is strange and unexplainable to me.

Even when I specify a lower compression rate (e.g. rate 2), the huge difference in pixel values remains. When I use lossless compression ("opj_compress -i test.tif -o test.jp2"), the result is as expected (output = input). The compression rate I got when using lossless compression is approx. 3,85.

Attached the test files "test.tif" and "test.jp2". I'm using openjpeg-v2.1.1.

testdata.zip

@rouault
Copy link
Collaborator

rouault commented Jul 29, 2017

This has been solved in trunk, presumably by 73d1510

@rouault rouault closed this as completed Jul 29, 2017
@detonin detonin added the bug label Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants