Skip to content

Commit 97b51df

Browse files
Merge pull request #92 from PlotPyStack/feature/91-svg-icons
Replace PNG icons with SVG icons
2 parents 7acefb5 + dd28031 commit 97b51df

397 files changed

Lines changed: 4052 additions & 277 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎doc/intro/licenses.rst‎

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ Additional asset licenses:
4242
-------------------------------------------------------------------------------
4343

4444

45-
Icons under plotpy/images
46-
=========================
45+
Icons under plotpy/data/icons
46+
=============================
4747

4848

4949
The following lists the source, license and accompanying details for
50-
image and icon under the plotpy/images directory.
50+
image and icon under the plotpy/data/icons directory.
51+
52+
The icons are SVG reconstructions (2026) of the historical PNG icons: the notices
53+
and licenses of the original artwork remain. They are also provided in the
54+
plotpy/data/icons/LICENSES.txt file.
5155

5256

5357
-------------------------------------------------------------------------------
@@ -66,7 +70,7 @@ Crystal Project Icons
6670
| Download (mirror): https://github.com/thecodingmachine/crystal-project
6771
| License: GNU Lesser General Public License 2.1 or later https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
6872
69-
No modifications made.
73+
Modifications: SVG reconstruction of the historical PNG icons, 2026.
7074

7175

7276
All Icons are free software; you can redistribute it and/or modify it under the
@@ -85,31 +89,31 @@ https://www.gnu.org/licenses/lgpl.html
8589

8690
Files covered:
8791

88-
* plotpy/images/arrow_down.png
89-
* plotpy/images/arrow_up.png
90-
* plotpy/images/editors/copywop.png
91-
* plotpy/images/editors/edit.png
92-
* plotpy/images/editors/editclear.png
93-
* plotpy/images/editors/editcopy.png
94-
* plotpy/images/editors/editcut.png
95-
* plotpy/images/editors/editdelete.png
96-
* plotpy/images/editors/editpaste.png
97-
* plotpy/images/editors/edit_add.png
98-
* plotpy/images/eraser.png
99-
* plotpy/images/exit.png
100-
* plotpy/images/editors/imshow.png
101-
* plotpy/images/editors/insert.png
102-
* plotpy/images/magnifier.png
103-
* plotpy/images/editors/plot.png
104-
* plotpy/images/editors/rename.png
105-
* plotpy/images/fileclose.png
106-
* plotpy/images/fileimport.png
107-
* plotpy/images/filenew.png
108-
* plotpy/images/fileopen.png
109-
* plotpy/images/filesave.png
110-
* plotpy/images/filesaveas.png
111-
* plotpy/images/print.png
112-
* plotpy/images/save_all.png
92+
* plotpy/data/icons/arrow_down.svg
93+
* plotpy/data/icons/arrow_up.svg
94+
* plotpy/data/icons/cell_edit.svg
95+
* plotpy/data/icons/edit.svg
96+
* plotpy/data/icons/editors/edit.svg
97+
* plotpy/data/icons/editors/edit_add.svg
98+
* plotpy/data/icons/editors/editcopy.svg
99+
* plotpy/data/icons/editors/editdelete.svg
100+
* plotpy/data/icons/editors/editpaste.svg
101+
* plotpy/data/icons/editors/filesave.svg
102+
* plotpy/data/icons/editors/imshow.svg
103+
* plotpy/data/icons/editors/insert.svg
104+
* plotpy/data/icons/editors/plot.svg
105+
* plotpy/data/icons/editors/rename.svg
106+
* plotpy/data/icons/eraser.svg
107+
* plotpy/data/icons/exit.svg
108+
* plotpy/data/icons/fileclose.svg
109+
* plotpy/data/icons/fileimport.svg
110+
* plotpy/data/icons/filenew.svg
111+
* plotpy/data/icons/fileopen.svg
112+
* plotpy/data/icons/filesave.svg
113+
* plotpy/data/icons/filesaveas.svg
114+
* plotpy/data/icons/magnifier.svg
115+
* plotpy/data/icons/print.svg
116+
* plotpy/data/icons/save_all.svg
113117

114118
-------------------------------------------------------------------------------
115119

@@ -125,7 +129,7 @@ Copyright (c) 2008 Python Software Foundation
125129
| License: Python Software Foundation License Version 2 https://docs.python.org/3/license.html
126130
| Trademark: Python Software Foundation Trademark Usage Policy https://www.python.org/psf/trademarks/
127131
128-
No modifications made.
132+
Modifications: SVG reconstruction of the historical PNG, 2026.
129133

130134

131135
The Python logo is a trademark of the Python Software Foundation,
@@ -153,7 +157,7 @@ https://docs.python.org/3/license.html
153157

154158
Files covered:
155159

156-
* plotpy/images/python.png
160+
* plotpy/data/icons/python.svg
157161

158162

159163
-------------------------------------------------------------------------------

‎doc/release_notes/release_2.12.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
* **Images on high-DPI screens** — With a display scaling factor such as 125 %, 150 % or 200 %, images were rendered at the resolution of the plot canvas and then upscaled to the screen resolution: with a 200 % scaling, images were shown with half the resolution of the screen, and with a 125 % scaling, one screen pixel row and column out of five were duplicated, which made fine image details (e.g. noise, thin lines) look irregular. Images are now rendered at the resolution of the screen; printing and exporting are not affected. Rendering images at the screen resolution takes more time: for a 2000 × 2000 image shown in a 700 × 700 plot, about 8 ms instead of 7 ms with a 125 % scaling and 19 ms instead of 7 ms with a 200 % scaling (104 ms instead of 28 ms with the anti-aliasing interpolation). The new `image/device_resolution` option of the `plot` configuration section restores the previous behavior
88
* **Raw image items** — `RawImageItem` objects were not drawn: each redraw failed with `ValueError: Invalid destination rectangle (expected tuple of 4 integers)`
9+
* **Blurry icons with display scaling** — PlotPy's icons (toolbar tools, item list, curve, marker and line styles, brush patterns, ...) were 16×16 pixel PNG images, which looked blurry with a display scaling greater than 100 % (e.g. 125 %, 150 %, 200 %). They are now SVG images, which remain sharp at any display scaling. Applications requesting a PlotPy icon by its former PNG name (e.g. `get_icon("csection.png")`) still get it with guidata 3.17.1 or later, whose `get_image_file_path` falls back to the SVG image with the same name. The notices of the original artwork are provided in `plotpy/data/icons/LICENSES.txt` (fixes [Issue #91](https://github.com/PlotPyStack/PlotPy/issues/91))
10+
* **Image lock tool icon** — The "Lock" tool of transformable images showed the "not found" icon until an image was selected: it now shows the lock icon
911

1012
⚡ Performance:
1113

‎plotpy/builder/annotation.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __get_annotationparam(
5353
readonly: bool | None = None,
5454
private: bool | None = None,
5555
) -> AnnotationParam:
56-
param = AnnotationParam(_("Annotation"), icon="annotation.png")
56+
param = AnnotationParam(_("Annotation"), icon="annotation.svg")
5757
if title is not None:
5858
param.title = title
5959
if subtitle is not None:

‎plotpy/builder/curvemarker.py‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def mcurve(self, *args, **kwargs) -> CurveItem | list[CurveItem]:
260260
basename = _("Curve")
261261
curves = []
262262
for yi, stylei in zip(y, style):
263-
param = CurveParam(title=basename, icon="curve.png")
263+
param = CurveParam(title=basename, icon="curve.svg")
264264
if "label" in kwargs:
265265
param.label = kwargs.pop("label")
266266
else:
@@ -406,7 +406,7 @@ def curve(
406406
)
407407

408408
basename = _("Curve")
409-
param = CurveParam(title=basename, icon="curve.png")
409+
param = CurveParam(title=basename, icon="curve.svg")
410410
if not title:
411411
global CURVE_COUNT
412412
CURVE_COUNT += 1
@@ -447,8 +447,8 @@ def merror(self, *args, **kwargs) -> ErrorBarCurveItem:
447447
""" # noqa: E501
448448
x, y, dx, dy, style = self.__get_arg_triple_errorbar(args)
449449
basename = _("Curve")
450-
curveparam = CurveParam(title=basename, icon="curve.png")
451-
errorbarparam = ErrorBarParam(title=_("Error bars"), icon="errorbar.png")
450+
curveparam = CurveParam(title=basename, icon="curve.svg")
451+
errorbarparam = ErrorBarParam(title=_("Error bars"), icon="errorbar.svg")
452452
if "label" in kwargs:
453453
curveparam.label = kwargs["label"]
454454
else:
@@ -569,8 +569,8 @@ def error(
569569
error(x, y, None, dy, marker='o', markerfacecolor='w')
570570
"""
571571
basename = _("Curve")
572-
curveparam = CurveParam(title=basename, icon="curve.png")
573-
errorbarparam = ErrorBarParam(title=_("Error bars"), icon="errorbar.png")
572+
curveparam = CurveParam(title=basename, icon="curve.svg")
573+
errorbarparam = ErrorBarParam(title=_("Error bars"), icon="errorbar.svg")
574574
if not title:
575575
global CURVE_COUNT
576576
CURVE_COUNT += 1
@@ -627,8 +627,8 @@ def histogram(
627627
:py:class:`.HistogramItem` object
628628
"""
629629
basename = _("Histogram")
630-
histparam = HistogramParam(title=basename, icon="histogram.png")
631-
curveparam = CurveParam(_("Curve"), icon="curve.png")
630+
histparam = HistogramParam(title=basename, icon="histogram.svg")
631+
curveparam = CurveParam(_("Curve"), icon="curve.svg")
632632
curveparam.read_config(CONF, "histogram", "curve")
633633
if not title:
634634
global HISTOGRAM_COUNT
@@ -980,7 +980,7 @@ def marker(
980980
Returns:
981981
:py:class:`.Marker` object
982982
"""
983-
param = MarkerParam(_("Marker"), icon="marker.png")
983+
param = MarkerParam(_("Marker"), icon="marker.svg")
984984
param.read_config(CONF, "plot", "marker/cursor")
985985
if (
986986
color

‎plotpy/builder/image.py‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def image(
218218

219219
assert isinstance(xdata, (tuple, list)) and len(xdata) == 2
220220
assert isinstance(ydata, (tuple, list)) and len(ydata) == 2
221-
param = ImageParam(title=_("Image"), icon="image.png")
221+
param = ImageParam(title=_("Image"), icon="image.svg")
222222
data, filename, title = self._get_image_data(
223223
data, filename, title, to_grayscale=True
224224
)
@@ -370,7 +370,7 @@ def maskedimage(
370370

371371
assert isinstance(xdata, (tuple, list)) and len(xdata) == 2
372372
assert isinstance(ydata, (tuple, list)) and len(ydata) == 2
373-
param = MaskedImageParam(title=_("Image"), icon="image.png")
373+
param = MaskedImageParam(title=_("Image"), icon="image.svg")
374374
data, filename, title = self._get_image_data(
375375
data, filename, title, to_grayscale=True
376376
)
@@ -468,7 +468,7 @@ def maskedxyimage(
468468
if isinstance(y, (list, tuple)):
469469
y = np.array(y)
470470

471-
param = MaskedXYImageParam(title=_("Image"), icon="image.png")
471+
param = MaskedXYImageParam(title=_("Image"), icon="image.svg")
472472
assert data.ndim == 2, "Data must have 2 dimensions"
473473

474474
self.__set_image_param(
@@ -533,7 +533,7 @@ def rgbimage(
533533
"""
534534
assert isinstance(xdata, (tuple, list)) and len(xdata) == 2
535535
assert isinstance(ydata, (tuple, list)) and len(ydata) == 2
536-
param = RGBImageParam(title=_("Image"), icon="image.png")
536+
param = RGBImageParam(title=_("Image"), icon="image.svg")
537537
data, filename, title = self._get_image_data(
538538
data, filename, title, to_grayscale=False
539539
)
@@ -593,7 +593,7 @@ def quadgrid(
593593
Returns:
594594
:py:class:`.QuadGridItem` object
595595
"""
596-
param = QuadGridParam(title=_("Image"), icon="image.png")
596+
param = QuadGridParam(title=_("Image"), icon="image.svg")
597597
self.__set_image_param(
598598
param,
599599
title,
@@ -682,7 +682,7 @@ def trimage(
682682
Returns:
683683
:py:class:`.TrImageItem` object
684684
"""
685-
param = TrImageParam(title=_("Image"), icon="image.png")
685+
param = TrImageParam(title=_("Image"), icon="image.svg")
686686
data, filename, title = self._get_image_data(
687687
data, filename, title, to_grayscale=True
688688
)
@@ -758,7 +758,7 @@ def xyimage(
758758
Returns:
759759
:py:class:`.XYImageItem` object
760760
"""
761-
param = XYImageParam(title=_("Image"), icon="image.png")
761+
param = XYImageParam(title=_("Image"), icon="image.svg")
762762
self.__set_image_param(
763763
param,
764764
title,
@@ -811,7 +811,7 @@ def imagefilter(
811811
Returns:
812812
:py:class:`.ImageFilterItem` object
813813
"""
814-
param = ImageFilterParam(_("Filter"), icon="funct.png")
814+
param = ImageFilterParam(_("Filter"), icon="funct.svg")
815815
param.xmin, param.xmax, param.ymin, param.ymax = xmin, xmax, ymin, ymax
816816
if title is not None:
817817
param.label = title
@@ -900,7 +900,7 @@ def histogram2D(
900900
:py:class:`.Histogram2DItem` object
901901
"""
902902
basename = _("2D Histogram")
903-
param = Histogram2DParam(title=basename, icon="histogram2d.png")
903+
param = Histogram2DParam(title=basename, icon="histogram2d.svg")
904904
if NX is not None:
905905
param.nx_bins = NX
906906
if NY is not None:

‎plotpy/builder/label.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def label(
8484
make.label("Absolute position", "R", (0,0), "R")
8585
"""
8686
basename = _("Label")
87-
param = LabelParamWithContents(basename, icon="label.png")
87+
param = LabelParamWithContents(basename, icon="label.svg")
8888
param.read_config(CONF, "plot", "label")
8989
if title:
9090
param.label = title
@@ -124,7 +124,7 @@ def legend(
124124
:py:class:`.LegendBoxItem` or
125125
:py:class:`.SelectedLegendBoxItem` object
126126
"""
127-
param = LegendParam(_("Legend"), icon="legend.png")
127+
param = LegendParam(_("Legend"), icon="legend.svg")
128128
param.read_config(CONF, "plot", "legend")
129129
param.abspos = True
130130
param.absg = anchor
@@ -155,7 +155,7 @@ def info_label(
155155
:py:class:`.DataInfoLabel` object
156156
"""
157157
basename = _("Computation")
158-
param = LabelParam(basename, icon="label.png")
158+
param = LabelParam(basename, icon="label.svg")
159159
param.read_config(CONF, "plot", "info_label")
160160
if title is not None:
161161
param.label = title

‎plotpy/builder/plot.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def gridparam(
365365
Returns:
366366
:py:class:`.GridParam`: grid parameters
367367
"""
368-
gridparam = GridParam(title=_("Grid"), icon="lin_lin.png")
368+
gridparam = GridParam(title=_("Grid"), icon="lin_lin.svg")
369369
gridparam.read_config(CONF, "plot", "grid")
370370
if background is not None:
371371
gridparam.background = background

‎plotpy/constants.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class PlotType(enum.Enum):
5959
# ===============================================================================
6060

6161
PARAMETERS_TITLE_ICON = {
62-
"grid": (_("Grid..."), "grid.png"),
63-
"axes": (_("Axes style..."), "axes.png"),
64-
"item": (_("Parameters..."), "settings.png"),
62+
"grid": (_("Grid..."), "grid.svg"),
63+
"axes": (_("Axes style..."), "axes.svg"),
64+
"item": (_("Parameters..."), "settings.svg"),
6565
}
6666

6767

0 commit comments

Comments
 (0)