I still think it's nuts that #Python's best solutions for rendering #SVG are a bunch of wrappers around CairoSVG with the two next best solutions being use Inkscape from the command line and wand, a wrapper around ImageMagick.
Example #167, and the very first example showing basic usage of the new https://thi.ng/geom-webgl interop package (still unreleased): Parsing a SVG path, sampling it with uniform vertex density (configurable), converting it into a complex polygon (w/ holes) and then into WebGL buffers (w/ vertex color option enabled), randomizing colors via probabilistic color theme, and — finally — drawing it all...
🆕 blog! “Getting lots of BIMI images using Python”
I've written before about the moribund BIMI specification. It's a way for brands to include a trusted logo when they send emails. It isn't much used and, apparently, is riddled with security issues. I thought it might be fun to grab all the BIMI images from the most popular websites, so I can potentially use […]
»Adobe will Zugriff auf Inhalte von Photoshop-Usern:
Der Konzern hat seine Nutzungsbedingungen aktualisiert. Wer zustimmt, gibt dem Unternehmen das Recht, auf seine Daten zuzugreifen.«
Ich empfehle und nutze schon länger @krita, @GIMP, @inkscape, @Blender und/oder @penpot aber ich bin ja kein Grafikprofi. Abgesehen davon wird selten zugegeben, dass die Fixierung auf einen Hersteller nicht unbedingt professionell ist.
🧵 …ich hatte weiter oben unter anderem auf @penpot hingewiesen. Um deren infos so wie dessen Einsatz zu lernen, folgt doch deren Videos Account im Fediverse auf @peertube und/oder deren Kanäle der einzelnen Sparten. Somit wird es sicherlich auch ein professionell nutzbare Photoshop Alternative für euch bei der Gestaltung von Webseiten.
Testing/debugging the dynamic tessellation feature of the upcoming thi.ng/geom-webgl interop package... This will provide a single polymorphic function to convert https://thi.ng/geom shapes into WebGL binary data & model/attribute specs, with lots of options for memory layout, indexing, instancing and other advanced usage...
By default (and as shown here), polygons are tessellated via ear cutting[1], but users have a choice of 9 other algorithm presets (or their own custom ones), incl. iterative application of multiple tessellation strategies..
As part of the work on the upcoming thi.ng/geom-webgl package, today I've also been completely rewriting all tessellators in https://thi.ng/geom-tessellate and extending the package with more features, incl. an adapted version of https://github.com/mapbox/earcut to handle complex polygons (with holes, but can also be combined/nested with all the other tessellators, incl. the non-triangular ones)...
Instead of producing an array of faces (each itself an vertex array), all tessellators are now producing/populating/adding to a single tessellation, consisting of a vertex array and another array of face vertex IDs. This makes the result much more flexible for a number of use cases, incl. WebGL/WebGPU conversion.
Very happy with how the new API for both packages is turning out. The last image shows the source code for generating a single frame of the "SB" anim, starting with parsing two SVG paths, grouping & fitting them into a target bounding rect, then tessellating the entire group, rebuilding a new group from the resulting triangles, and finally serializing everything to SVG. For WebGL, there'll be a single asWebGLModel() function which performs shape tessellation automatically behind the scenes (fully configurable, though)...
Current status: Updating the https://thi.ng/geom readme to give a better overview of the full extensive API, ahead of the v8 release (soon)... Attached are screenshots of three sections of the readme showing:
list of 32 shape types (both 2D and 3D)
list of 54 polymorphic functions/operations to manipulate/convert/analyze shapes & shape hierarchies
list of additional 40 shape creation functions
Still to come: Documenting the bundled preset implementations of:
vertex convolution kernels (3)
curve subdivision strategies (8)
polygon/polyline to bezier conversion strategies (3)
polygon tessellators (9)
(...and how most of these can be combined & applied iteratively. Some of the recent/existing examples are already hinting at the potential...)
Added a new small example for a new feature in https://thi.ng/geom, which allows embedding custom https://thi.ng/hiccup data/elements (e.g. for presentation/visualization purposes) into shape/geometry hierarchies...
In the example we're using some gradient definitions and then also show how the same geometry can be drawn to canvas and serialized to SVG
(Again, as with the other recent new examples, this is about an still unreleased feature of the upcoming v8.0.0 of https://thi.ng/geom, one of the biggest updates in recent years...)
Man, I just really love #SVG and #CSS. Built a little distortion effect in SVGFM (https://svgfm.chriskirknielsen.com/ always be plugging), then added an animation tag in the turbulence primitive to get some movement, converted that to a data URI SVG with the filter ID at the end, and voilà, shown on hover!
PS: Of course it doesn't work at all in Safari, and looks pretty poor in Chrome compared to Firefox. 🫠
So many new and improved features (+ new shape types) coming to https://thi.ng/geom (more about those soon) — for now a new tiny example to show point classification (inside/boundary/outside) for polygons:
‹text› method allows anyone to change the font as well as to translate the text.
‹path› method is “embedded” (if you will), and thus, not translatable and the font design is fixed.
It's licensed under #CreativeCommons#BySA 4.0 because the source file, in PNG format, is under the same license. I actually prefer to release it under CC0/CCzero (a.k.a. Public Domain). Although in some jurisdictions, it can only be Public Domain because there's nothing artistic about an ISO-based keyboard layout.
I'm slowly making my way through a 8 thousand line python addition to #inkscape's #python library for parsing text and font elements in #svg properly. It's important and useful, but it's also a lot.
I'm not sure how to say "please run pylint over your code because my eyes hurt trying to read this". without sounding like an ungrateful jerk. 😅
I announced the new version of my art code yesterday, and a new slew of solid geometry stuff and hooks to my art shell was part of it. So here's a little bonus treat made with these things:
"large red fish fills portland dodecahedron at center"