esphome / esphome/feature-requests

Proper Anti-aliasing for imported SVG images

Open
#2,809 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

Currently if you import an SVG files using image: the resulting image is jagged (not anti-aliasing). Every other type of vector graphics import in ESPhome is Anti-aliased.
This appears to be because every other type of file is imported using the Pillow library and this does anti-aliasing by default. SVG in ESPhome are imported using cairosvg which does not have the capability to anti-alias. Probably the easiest way to resolve this would be to first convert the SVG to PNG using cairosvg then resize the image using Pillow.

And ever better option would be to use ImageMagick to convert SVG to PNG. This does very high quality conversions that look **much better** then the ones from cairosvg. This would be a one line change to the ESPhome code.

**Please describe your use case for this integration and alternatives you've tried:**

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file, test, or entry point is named in the request. Start by locating ESPHome's SVG image-import path and reviewing how CairoSVG and Pillow are used; done means imported SVG images render with anti-aliasing and the existing image-import behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.