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

ESP32-S3-EYE工程logo替换遇到的问题 (AIV-656) #276

Open
FitzzzzZZZZ opened this issue Oct 8, 2023 · 3 comments
Open

ESP32-S3-EYE工程logo替换遇到的问题 (AIV-656) #276

FitzzzzZZZZ opened this issue Oct 8, 2023 · 3 comments

Comments

@FitzzzzZZZZ
Copy link

FitzzzzZZZZ commented Oct 8, 2023

我直接将工程ESP32-S3-EYE中AppLCD接口中的logo_en_240x240_lcd数组中的数据替换,显示的颜色异常,形状是对的。
我是将图片通过RGB888转成RGB565格式的16位无符号整形数组,显示的图片如下。

U4%FO)MY6B3D~I6~ RX73J](https://github.com/espressif/esp-who/assets/138110995/1904ae22-d7bc-4bbb-ac7c-776ee52227eb) ![0(}(8DIQMF9I3OS8K$8S%M

@FitzzzzZZZZ
Copy link
Author

U4%FO)MY6B3D~`I6~ RX73J
转换前的图片

@github-actions github-actions bot changed the title ESP32-S3-EYE工程logo替换遇到的问题 ESP32-S3-EYE工程logo替换遇到的问题 (AIV-656) Oct 8, 2023
@FitzzzzZZZZ
Copy link
Author

RGB888转RGB565的程序如下:
from PIL import Image

def image_to_rgb565_array(image_path):
img = Image.open(image_path)
img = img.convert('RGB') # Convert image to RGB mode

width, height = img.size
rgb565_array = []

for y in range(height):
    for x in range(width):
        r, g, b = img.getpixel((x, y))
        # Convert RGB to RGB565
        rgb565_value = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3)
        rgb565_array.append(rgb565_value)

return rgb565_array

Replace 'your_image_path.jpg' with the actual path to your image

image_path = 'your_image_path.jpg'
rgb565_array = image_to_rgb565_array(image_path)

Print the resulting array

print(rgb565_array)

@WangYuxin-esp
Copy link

WangYuxin-esp commented Oct 9, 2023

图像正确、颜色不对的问题,可能是 R\G\B 三分量的顺序与 LCD 要求的 R\G\B 分量的顺序不同导致的。请检查 LCD、图像数据的 R\G\B 分量的顺序、大小端是否一致。

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