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

Let libpng expand the color channels to 16 bit if requested #92

Closed
Starry-lei opened this issue Dec 29, 2022 · 2 comments
Closed

Let libpng expand the color channels to 16 bit if requested #92

Starry-lei opened this issue Dec 29, 2022 · 2 comments

Comments

@Starry-lei
Copy link

I guess it is a bug that the code for "Let libpng expand the color channels to 16 bit if requested" is written as " if (output_bit_depth == 16 && bit_depth < 16)". (libvis/src/libvis/image_io_libpng.cc)

it should be if (output_bit_depth == 16 && bit_depth ==16), right :) ?

@puzzlepaint
Copy link
Collaborator

Why do you think that it should be changed to that?

The intention here is that if the output image has 16 bits per pixel, the code asks libpng to scale the PNG image data to 16 bits per pixel as well, by calling png_set_expand_16(). If the output image and the PNG data already both have 16 bits per pixel, then no action is necessary.

@Starry-lei
Copy link
Author

Thanks for the reply, now I got it, you are right.

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