forked from LoveBootCaptain/WeatherPi_TFT
-
Notifications
You must be signed in to change notification settings - Fork 1
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
[RESEARCH] use svg icons and layers to generate weather icons #2
Comments
Hi @LoveBootCaptain,
If you want to use the icon provided by Weatherbit.io in WeatherPi, how
about getting the icon from the web and resizing it, and you can use the
anti-aliasing process with Pillow package.
See modules/WeatherModule.py:weather_icon(). It is implemented with the
above ideas. (OpenWeather Icon:
https://openweathermap.org/weather-conditions)
You can also use the @lru_cache() decorator to use an icon once retrieved
over and over again.
I don't have any experience with SVG, but how about using the svgwrite
package (https://pypi.org/project/svgwrite/).
Be safe, be kind to others, be healthy,
Yoshihiko Miyacichi
2020年5月15日(金) 1:46 LoveBootCaptain <notifications@github.com>:
… hi @miyaichi <https://github.com/miyaichi>,
you are maybe the right guy to discuss this creazy idea I had while I was
creating all the new weather state icons for weatherbit.io api.
to be as effective as hell in generating all the options:
https://www.weatherbit.io/api/codes I used my designer tools like Adobe
Illustraor and Affinity Designer to create like 1000 different layers of
svg shapes which i can "click together" to have consistent icon sizes and
states.
we use this technique quite often in the web and merge different svg
layers of curves to generate a downloadable pdf document in one of our
customer projects. In the web it is quite common. In pygame it's still a
little challange to render svg's from my research.
the idea would be the following:
- have different shapes for all needed weather state combinations
- find a way to render a svg shape with specific color
- layer diffrent svg with their own color
- render the layered svg as pygame.image maybe
maybe this will create some crazy possibilities in using the ultrasharp
icons on every display size or icon size and theming as well for the user.
if you are interested in this "research task" i would share those prepared
layers with you and maybe tinker a solution for have all possible options
in one layerset (like a sprite of svg's).
what do you think? worth trying to think about that together?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA7WBKE5YGLZ7W7S2L3S2TRRQN7VANCNFSM4NA3ICAQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi @miyaichi,
you are maybe the right guy to discuss this creazy idea I had while I was creating all the new weather state icons for weatherbit.io api.
to be as effective as hell in generating all the options: https://www.weatherbit.io/api/codes I used my designer tools like Adobe Illustraor and Affinity Designer to create like 1000 different layers of svg shapes which i can "click together" to have consistent icon sizes and states.
we use this technique quite often in the web and merge different svg layers of curves to generate a downloadable pdf document in one of our customer projects. In the web it is quite common. In pygame it's still a little challange to render svg's from my research.
the idea would be the following:
maybe this will create some crazy possibilities in using the ultrasharp icons on every display size or icon size and theming as well for the user.
if you are interested in this "research task" i would share those prepared layers with you and maybe tinker a solution for have all possible options in one layerset (like a sprite of svg's).
i already found a way to render one-color-icons (like my status bar icons) with a color of my choice (or theme definitions). please have a look here: https://github.com/LoveBootCaptain/WeatherPi_TFT/blob/f283ef51a87e4a2b6ea0ce1ca46f9ea7f6081fc3/WeatherPi_TFT.py#L222. I also switched to Image.resize and reduced my Iconset and changed all icons to 200x200px since the exported png's are quite sharp and when you scale them properly the didn't look worse than as I exported them in 100x100, 50x50 or 30x30. thx also for the hint here... (still have to invest time in modularisation and rewrite some 4 years old "beginners code")
what do you think? worth trying to think about that together?
here a little teaser:
test-weather.svg.zip
The text was updated successfully, but these errors were encountered: