Skip to content

Scaling 16-bit Greyscale PNGs #3845

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

Open
Xaldew opened this issue Apr 27, 2025 · 0 comments
Open

Scaling 16-bit Greyscale PNGs #3845

Xaldew opened this issue Apr 27, 2025 · 0 comments
Labels

Comments

@Xaldew
Copy link

Xaldew commented Apr 27, 2025

Environment

Python Version: Python 3.10.12

Nikola Version: Nikola v8.3.1

Operating System: Ubuntu 22.04 (Jammy)

Description:

It seems like it's not possible to create thumbnails for PNG files that are using the 16-bit greyscale format (sample file attached below). I'm currently seeing the warning:

[2025-04-27 14:34:47] WARNING: scale_images: Can't process images/teaser.png, using original image! (image has wrong mode)
[2025-04-27 14:34:47] WARNING: scale_images: Can't process images/teaser.png, using original image! (image has wrong mode)

I had a brief look at the image_processing.py file (https://github.com/getnikola/nikola/blob/master/nikola/image_processing.py#L153), and it seems like most of the work is delegated to Pillow, which, as far as I can tell, should support greyscale 16-bit images through the I;16 format (https://pillow.readthedocs.io/en/stable/handbook/concepts.html), as such it's unclear what the real issue is here.

Tangentially, it may also be a good thing to include what the mode is in the error message above.

Image

@Xaldew Xaldew added the bug label Apr 27, 2025
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

1 participant