Skip to main content

SKITSO

greek for drafting

What it's skitso?

Built on top of Pillow, skitso it's a lightweight scenes generator. It may be think as newborn nephew of manim.

    It's way smaller, and it's somehow related.

With very simple shape primitives you can define your scene, and them you explicitely take snapshots of the frames you want to capture. That's it.

A bit more of details:

  • You create simple geometric visual elements (Lines, Rectangles, Arrows). Their basic characteristics (dimensions, size, color, and positioning on a Cartesian plane) are used to generate a specific graphical representation using the @pillow library
  • You can define new objets, based on simpler ones as composition of them.
  • Each object (simple, complex, or user defined) can be precicely placed on the space.
  • Scene module, which is basically a collection of visual objects, and a method tick which exports the current composition to a sequentially numerated frame (png file).

Examples

Simplest scene

from skitso.scene import Scene
from skitso.shapes import Rectangle, Line

class SimplestScene(Scene):

   def render(self):
       self.tick()
       self.add(Rectangle(x=100, y=100, width=100, height=100, fill_color="red"))
       self.tick()
       self.add(Line(0, 0, 600, 400, "white", 1))
       self.tick()

if __name__ == "__main__":
   canvas_size = (600, 600)
   my_scene = SimplestScene(canvas_size, "output_path", "black")
   my_scene.render()

That will create the 3 following frames

Frame 01 Frame 02 Frame 03

Creating new object kind, and displacements

And instead, if you want to get a feeling of creating new objects lets work with namedrectangles

from skitso.atom import Container, Point
from skitso.shapes import Rectangle, Text

class NamedRectangle(Container):
   def __init__(self, x, y, width, height, fill_color, name):
       super().__init__(Point(x, y))
       self.name = name
       self.add(Rectangle(x, y, width, height, fill_color=fill_color))
       self.add(Text(x * 1.05, y, self.name, font_name="Monospace",
                     font_size=28, color="white", stroke_fill="gray", stroke_width=1))

And now a scene where this new figure is used, and where objects are moved between frames

class MazeScene(Scene):
   def render(self):
       canvas_height, canvas_width = self.height, self.width
       offset = canvas_height / 15
       rectangles = []
       # Create concentric colored NamedRectangles
       colors = ["tomato", "firebrick", "maroon", "rebeccapurple", "midnightblue",]
       for i, color in enumerate(colors, start=1):
           margin = offset * 2 * i
           new_rect = NamedRectangle(
               x=offset * i, y=offset * i, fill_color=color, name=color,
               width=canvas_width - margin, height=canvas_height - margin,
           )
           rectangles.append(new_rect)
           self.add(new_rect)
       # Initial frame with all rectangles
       self.tick()

       # Move all rectangles to the right
       gravity_corner = mov.Aligment(mov.AlignmentDial.LOW, mov.AlignmentDial.HIGH)
       for i in range(len(rectangles) - 1):
           rect = rectangles[i + 1]
           prev = rectangles[i]
           rect.to_edge(prev, gravity_corner)
           self.tick()

The frames generated in this case are the ones that follow. Take a look of how each named-rectangle falls down between each frame.

Frame 04 Frame 05 Frame 06 Frame 07 Frame 08

Release files for skitso 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skitso 0.1.13
File Size Uploaded
skitso-0.1.13.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for skitso 0.1.13
File Interpreter ABI Platform
skitso-0.1.13-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / skitso-0.1.13.tar.gz

Download URL skitso-0.1.13.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9a31517579cbde1939b5bf179e00eddfb69c76d8c1513ba9a14e0266f0006fc5
BLAKE2b-256 checksum
How to use checksums
d92e5a4e1fc691b279515ea9d54471f151631d460717e99c2526d751d5141e84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.7 Darwin/21.6.0

Release files / skitso-0.1.13-py3-none-any.whl

Download URL skitso-0.1.13-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2baccdf4a5008dd73120d4bfa574f89f828e13a8c58c8bdb20927506217612ac
BLAKE2b-256 checksum
How to use checksums
316dffcdd8890afc1fc2ed2a41ff61e95d4b00a6e85d3db5b2c661b5a425f7af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.7 Darwin/21.6.0

Release history Release notifications | RSS feed

This release

0.1.13 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page