Included Alpha Channel graphic Images

69 views
Skip to first unread message

José Cervera

unread,
Jun 9, 2021, 8:16:08 PM6/9/21
to weewx-user

Hi. Congratulations on Weewx.
It would be quite a detail that in future versions the possibility of adding hexadecimal colors with Alpha channel will be included. Currently, the function to create the image from RGB to RGBA must be modified in genplot.py and also add in utilities.py the condition that includes ff of the Alpha channel.

gjr80

unread,
Jun 9, 2021, 8:25:26 PM6/9/21
to weewx-user
Hi,

Pull requests are always welcome :)

Gary

Chuck Rhode

unread,
Jun 10, 2021, 3:39:26 PM6/10/21
to weewx...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 9 Jun 2021 13:16:08 -0700 (PDT)
José Cervera <chv...@gmail.com> wrote:

> It would be quite a detail that in future versions the possibility of
> adding hexadecimal colors with Alpha channel will be included.

The Phenology extension to WeeWX comes equipped with an alternate image
generator that does composition with transparency.

o http://lacusveris.com/Phenology/phenology_image_generator.shtml


- --
.. Be Seeing You,
.. Chuck Rhode, Sheboygan, WI, USA
.. Weather: http://LacusVeris.com/WX
.. 81° — Wind Calm

-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQT+MY/5I/LMPSswTbVg2/xipKOWUgUCYMIyHgAKCRBg2/xipKOW
UrldAJ9D1ExR09TVs1MqI9vcudQpuAqn3wCbBvhc4aJ4sP0WfeTawfQHMFJoSn8=
=sDxA
-----END PGP SIGNATURE-----

José Cervera

unread,
Jun 19, 2021, 6:48:28 PM6/19/21
to weewx-user
Thanks
The Phenology extension is perfect but, offering more possibilities in basic skin is the objective.
Regards

Chuck Rhode

unread,
Jun 19, 2021, 8:33:10 PM6/19/21
to weewx...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 19 Jun 2021 11:48:28 -0700 (PDT)
José Cervera <chv...@gmail.com> wrote:

> The Phenology extension is perfect but, offering more possibilities
> in basic skin is the objective.

There must be some *javascript* modules that already exist for
producing real-time graphs from hypertext markup similar to the way
algebraic formulae are rendered by MathJax:

o https://www.mathjax.org/

Then WeeWX could provide Cheetah *.tmpl files for the charts without
having to provide the *imagegenerator.py*.

... but I haven't found any *javascript* charting modules that seem
robustly supported.

This surely is **not** the focus of *pillow* or *matplotlib*. These
are both module libraries for creating image files, not necessarily
for rendering charts in *.html.

The "P" in *pillow* stands for Python, and it can be used online from
well-formed Python *cgi* scripts. If your goal is to force the reader
to spend his own machine cycles to render your graphics, then *pillow*
is not for you because it runs on the server side, not the client.

In the case of WeeWX, *pillow* is called by the *imagegenerator.py*.
Then, the resulting offline image files are uploaded to wherever your
web page(s) can get at them. You are, however, stuck with whatever
functionality is baked into *imagegenerator.py*.

*matplotlib* is similar, but with higher-level instructions for
rendering different kinds of plots. Neither *pillow* nor *matplotlib*
seem to provide any native scripting language for building charts.
Instead, they provide libraries of Python object classes for you to
use in your own Python scripts.

*Gimp* does provide a scripting function, though. It just doesn't
seem to be well documented. I believe you're expected to record
scripts during a live *Gimp* session and edit them afterward. I
gather it's mostly useful for applying a fixed repertoire of filters
to photos gathered from the wild.

You can use *netpbm* and *imagemagick* for that, too. Both of those
can be manipulated from *shell* scripts.

It comes down to this IMNSHO: Producing graphs with any degree of
flexibility is deucedly difficult because of the wordiness required.
The graph options are certainly countable, but they tend toward the
infinite. The Phenology Image Generator uses about 70 (a great deal
more than the WeeWX Image Generator), and they both produce a fixed
repertoire of graphs limited to time-series data.

- --
.. Be Seeing You,
.. Chuck Rhode, Sheboygan, WI, USA
.. Weather: http://LacusVeris.com/WX
.. 71° — Wind E 7 mph

-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQT+MY/5I/LMPSswTbVg2/xipKOWUgUCYM5UfAAKCRBg2/xipKOW
UmsGAJ4xnnu87cV1smQGqLmti1ci9CRkSACeLi4mvm58VRC9QZD7luWbkGnjqU8=
=nGbx
-----END PGP SIGNATURE-----

Chuck Rhode

unread,
Jun 19, 2021, 8:50:38 PM6/19/21
to weewx...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 19 Jun 2021 11:48:28 -0700 (PDT)
José Cervera <chv...@gmail.com> wrote:

It's merely possible that your browser can be rigged to interpret "R"
code for rendering charts.

- --
.. Be Seeing You,
.. Chuck Rhode, Sheboygan, WI, USA
.. Weather: http://LacusVeris.com/WX
.. 70° — Wind NE 9 mph

-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQT+MY/5I/LMPSswTbVg2/xipKOWUgUCYM5YmQAKCRBg2/xipKOW
UiBtAJ9jJ5zu6cSk6kDn0/k1v68IOqzyrgCZAf5wRjQ8ub+2yoaBFKr4Dlx5VMs=
=LEYE
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages