Repository navigation
PlotPy Version 2.12.1
🛠️ Bug fixes:
- 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_resolutionoption of theplotconfiguration section restores the previous behavior - Raw image items —
RawImageItemobjects were not drawn: each redraw failed withValueError: Invalid destination rectangle (expected tuple of 4 integers) - 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, whoseget_image_file_pathfalls back to the SVG image with the same name. The notices of the original artwork are provided inplotpy/data/icons/LICENSES.txt(fixes Issue #91) - Icon name conflicts — Several PlotPy icons share their names with icons of guidata or of applications (e.g.
image.svg,histogram.svg,apply.svg,delete.svg): with guidata 3.17.1, which gives precedence to the icons of applications and warns about ambiguous image names, PlotPy designates these icons explicitly (e.g."plotpy:image.svg","guidata:apply.svg"), so that its widgets keep their icons in applications. The icons that were exact copies of guidata icons (editors, file types, ...) are no longer shipped by PlotPy, which uses those of guidata (fixes Issue #93) - 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
- Blurry Save as, Help, Open and Save items icons — With a display scaling greater than 100 % (e.g. 150 %, 200 %), the icons of these tools were blurry, as their standard Qt icon was frozen to a 16-pixel image upscaled to the toolbar icon size: they now keep all the resolutions of the icon and are shown at the same size as the other toolbar icons (fixes Issue #95)
⚡ Performance:
- Moving shapes over images — Moving or resizing a shape, a marker, a cursor or an annotation over an image, or drawing a new shape, rendered the image again for each mouse move, although it did not change. The previous rendering of the image is now drawn again instead, unless the image itself, the plot axes or the plot size change: with a 2048 × 2048 image, each mouse move takes about 4 ms instead of 7 to 68 ms depending on the interpolation, and about 10 ms instead of 17 to 175 ms with a 200 % display scaling (see the
plotpy/tests/benchmarks/test_image_interaction.pybenchmark). The newBasePlot.replot_overlaysmethod redraws a plot in this way, when only items drawn over images have changed: image items whosedraw_imagemethod is decorated withplotpy.items.image.base.reusable_renderingdraw their previous rendering again. As before, any other change of an image item (data, mask, contrast, colormap, ...) must be followed byBasePlot.replotorBasePlot.invalidate - Masked images — The mask of masked images (
MaskedImageItem,MaskedXYImageItem) is no longer rendered when it is not visible, i.e. when no pixel is masked and the unmasked area is transparent (default): rendering a masked image without masked pixels, e.g. while panning or zooming, is up to 25 % faster