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 does pgxtoimage have special handling for prec < 8? It seems to corrupt PGX with low bits per pixel. #1571

Open
Neopallium opened this issue Dec 24, 2024 · 0 comments

Comments

@Neopallium
Copy link
Contributor

I am trying to understand the reason for force8 logic here:

if (prec < 8) {

Since it seems to corrupt the pixel values.

That logic seems to upsample the pixels to larger then 8-bits:

--- File=./data/baseline/conformance/c1p0_03_0.pgx
endian1=M, endina2=L, sign=' -', prec=4, w=256, h=256
---- prec=4 before `force8`
---- prec=8 after `force8`
---- prec=13 after decoding the pixels, max=4471

The PGX file had prec=4 and was scaled up to prec=13.

I disabled that logic and decode the pixels the same way as prec==8 (i.e. change the if to prec <=8):

endian1=M, endina2=L, sign=' -', prec=4, w=256, h=256
---- prec=4 from file header
---- prec=3 after decoding the pixels, max=5
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