All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Improved debug visualization, now showing the nine points on the bounding box for
pin
mimicking the style of vector graphics programs
- Fixed setuptool configuration, the previous version was not importable
- Housekeeping: update
__version__
string and move touv
as a project/package manager
PyTamaro is now mature enough for a 1.X release!
- The library is now compatible with Python 3.13 and requires at least Python 3.10
- English names are no longer importable from modules dedicated to other languages (e.g.,
pytamaro.it
)
- Instead of workarounds, perform antialias using SSAA (4x) to avoid seams and stroke-related artifacts when circular shapes are at the edges
- Names of parameters and types in error messages are now reported inside backticks to make them more distinguishable from the rest of the message
- Raise an error when trying to show an animation whose frames are not all of type
Graphic
- Rendered text now includes leading and trailing glyphs without outline (such as spaces)
- Avoid crashing when showing graphics with a zero area after rounding
- Avoid crashing when showing animations with zero area frames
- Reduce visible seams when rendering adjacent shapes with antialiasing
- Fixed some inconsistent names for localized parameters in the documentation
- Enable antialiasing for better rendering
- Faster rendering of images, especially noticeable for GIFs with several frames
- Fix GIFs overlaying frames within a loop, which was visibile in certain cases with transparency
- Round the size of graphics used as GIF frames (mainly to accommodate rounding errors)
- Raise an error when graphics of different sizes are used as GIF frames
- Proper
Point
'srepr
for unknown points
- Support Python 3.12 for real (upgrade
skia-python
to v121) - Fix SVG output of (semi-)transparent black color (#24)
- Support Python 3.12 (skia-python upgrade)
- Produce a warning message when a font that is not available is used to produce a graphic with
text
- Do not show subclasses of
Graphic
in error messages
- French version of the library (importable from
pytamaro.fr
): full translation of the API and the documentation (#25 by @karma-riuk) - Graphics (as well as points and colors) now have a
__repr__
method which returns a more useful, localized string representation
- Fix SVG files' transparent background rendered as black in edge cases
- Fix the pinning position for a
circular_sector
of 360 degrees - Attempt to prevent a rare condition in which saving an SVG file could fail
- Data URIs (used in one of the output modes) are now wrapped in special markers so that they can be recognized within a larger output.
- Fix rendering of reasonably big graphics (by increasing the recursion limit)
- New function
show_animation
to show an animation (without having to explicitly save it to a file) in an appropriate viewer (e.g., a Jupyter notebook, Safari on macOS, ...). Multi-OS support is still experimental.
- The function
save_gif
has been renamed tosave_animation
to decouple the concept (an animation) from the format (GIF). There is now a nice symmetry betweenshow_graphic
,save_graphic
,show_animation
andsave_animation
. - SVG files are now saved with an extra attribute (
shape-rendering="crispEdges"
) to achieve a better rendering for our use case and avoid the occasional tiny gaps between adjacent shapes.
- Improve Jupyter notebook detection to include Google Colab
This version introduces a number of API breaking changes. The documentation of the old version is still available under the version_2022
tag..
- Functions' parameters (their types and values) are now explicitly checked at runtime to provide less confusing error messages when the supplied values are not valid
pin
now takes a parameter of typePoint
to specify the pinning position, instead of two strings; the usual nine notable points on the bounding box are available as constants (e.g.,top_left
,center
,bottom_right
- The initial pinning position for certain primitive graphics is no longer at the center of the bounding box, but at a custom documented point of interest (e.g., the centroid for triangles, or the leftmost point on the baseline for text)
triangle
can now create arbitrary triangles, not just equilateral ones, by specifying two sides and the angle between themcircular_sector
now allows only for degrees in the range [0, 360] (where 360 effectively produces a full circle)- Counterclockwise rotation is consistently used throughout the library (e.g., for rotation,
circular_sector
,triangle
) save_graphic
now allows saving a graphic using the SVG format; bothsave_graphic
andsave_gif
now require the extension of the desired file to be specified as part of the filenamebeside
,above
andoverlay
now pin the resulting graphic at its center (this makes them truly associative, and allows to explain their behavior without the need to explain the pinning position in the beginning)- Showing or saving as a PNG a graphic with no area now produces a warning
- Equality of graphics is now based on the equality of their scene graphs and their pinning positions, instead of the rendered bitmaps
show_graphic
prints a data URI representation of the graphic when the environment variablePYTAMARO_OUTPUT_DATA_URI
is set
- New
hsl_color
andhsv_color
functions to specify colors using HSL / HSV
rgb_color
(and the newly added functions) now takes an optionalopacity
parameter (which defaults to a fully-opaque color)- Improved the documentation of colors
rgba_color
is now superseeded byrgb_color
with theopacity
parameter
- Add
py.typed
to comply with PEP 561
- Fixed the coding style (due to a bad previous release)
- Fixed a bug that was causing the pinning position to be shown in the wrong place (in debug mode)
- Upgraded to
pillow
9.2.0 fixing an issue with transparent GIFs
- New
loop
parameter forsave_gif
- Show localized types in the documentation
- Graphics are now represented as a scene graph, based on
skia-python
- Support glyphs without outline (e.g., the space character) in
text
- Initial Version based on
pillow