Giter Site home page Giter Site logo

Comments (4)

nagyrobi avatar nagyrobi commented on June 20, 2024 1

Some tests:

        - obj:  # background for test transparency
            id: color_matte
            x: 0
            y: 40
            width: 240
            height: 240
            bg_color: 0x00ffff
            bg_opa: cover
            radius: 0
            pad_all: 0
            border_width: 0
            widgets:
              - img:
                  align: center
                  src: esphome_logo_transparent
                  id: img_transp

with:

image:
  - file: https://esphome.io/_static/made-for-esphome-black-on-transparent.png
    id: esphome_logo_transparent
    resize: 220x72
    type: # as below
    use_transparency: # as below

with type: TRANSPARENT_BINARY (transparency enabled by default) results in:
kép

with type: GRAYSCALE results in (same result with dither: FLOYDSTEINBERG):
kép

with: type: GRAYSCALE and use_transparency: true results in (nothing):
kép

with type: RGB565 results in:
kép

with type: RGB565 and use_transparency: true results in:
kép

with: type: RGB24 results in:
kép

with: type: RGB24 and use_transparency: true results in:
kép

with: type: RGBA (transparency enabled by default) results in:
kép

from esphome.

nagyrobi avatar nagyrobi commented on June 20, 2024

Supported encodings?

from esphome.

nagyrobi avatar nagyrobi commented on June 20, 2024

Repeated some of the tests with SVG image instead of PNG:

image:
  - file: https://esphome.io/_static/made-for-esphome-black-on-transparent.svg
    id: esphome_logo_transparent
    resize: 220x72
    type: # as below
    use_transparency: # as below

with type: TRANSPARENT_BINARY (transparency enabled by default) results in:
kép

with: type: GRAYSCALE and use_transparency: true results in (nothing):
kép

with type: RGB565 and use_transparency: true results in:
kép

from esphome.

nagyrobi avatar nagyrobi commented on June 20, 2024

I think situation is similar to the fonts, LVGL seems to use a proprietary format, and they have online and offline converter tools for images to C arrays: https://lvgl.io/tools/imageconverter

It's two approaches here:

  • the command line tool can be used before compile, like pillow or cairo are used (add another type: LVGL with sub-options maybe?)
  • some other implementation needs to be done at runtime for #14

from esphome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.