pascalw / kindle-dash

Power efficient dashboard for Kindle 4 NT devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image aspect ratio morphed/incorrect

tobire opened this issue · comments

First of all: excellent software!

I created a simple python script to create images to display. Unfortunately, the image is somehow morphed:
IMG_20210216_220700

This is the displayed file:
db

I tried to load it directly from my python script aswell as directly from nginx and in both cases the image was morphed.

Would be nice if you have an idea on how to fix this :)

Hi @tobire the Kindle only handles Grayscale PNGs correctly. Your PNG has an 8bit color/alpha profile. This is probably something you can specify in your Python code when generating the PNG. Alternatively you can convert the image using pngcrush: pngcrush -c 0 dash.png.

Let me know if that works!

It's kind of working now.
The image is not as stretched anymore but there are still not all 600x800 Pixels visible.
I added a border this time to make sure that I see it correctly:
IMG_20210217_065735
db

Are there any more requirements to the image in order for it to get displayed correctly?
Your example image is working fine btw.

Ah, nevermind, I made a mistake.
I used Pillow to convert the image to grayscale however the code found in a StackOverflow answer apparently did not work correctly.
After using pngcrush like you said, it's displayed correctly.
Thanks for the help! :)

In case anyone else wants to convert their image to grayscale in Python, this code works:

from PIL import Image, ImageOps
ImageOps.grayscale(Image.open('image.png')).save('grayscale.png')

Great! 👍