Skip to content

Python utilities for conversion of bitmap image to 3D objects mosaic in POVRay format.

License

Notifications You must be signed in to change notification settings

Dnyarri/POVmosaic

Repository files navigation

(EN) (RU)

Bitmap to 3D solid mosaic converter

Python utilities for conversion of bitmap image (in PNG format) to some sort of solid objects mosaic in POVRay format. Development is likely to be continued, program list is about to propagate.

Example of p6zaika export rendering

Brief programs description - simple solid primitives

  • s3zaika - converts every single pixel into solid sphere. Spheres are packed into triangle grid (C3 symmetry). Sphere height over source plane depends on random, adding some releif to avoid monotonous shadow pattern.
  • s4zaika - converts every single pixel into solid sphere. Spheres are packed into square grid (C4 symmetry). Sphere height over source plane depends on random.
  • c3zaika - converts every single pixel into solid cylinder. Cylinders are packed into triangle grid (C3 symmetry). Cylinder height over source plane depends on source image brightness, adding some releif (like rough heightfiled). Overall, it may be considered as hybrid of s3zaika (C3 symmetry) and b4zaikaS (height mapped to source brightness) using cylinders.
  • b4zaikaS - converts every single pixel into solid box. Boxes are packed into square grid (C4 symmetry, regular plane partition 44) and Scaled so that box height is controlled by source image brightness, adding some releif (like rough heightfiled).
  • b4zaikaR - converts every single pixel into solid box. Boxes are packed into square grid (C4 symmetry) and Rotated randomly around x,y and according to source image brightness around z, thus providing some artistic effect.
  • p3zaika - converts every single pixel into solid triangle prism. Prisms are packed into triangle grid (C3 symmetry) - 36 regular plane partition - and scaled so that prism height is controlled by source image brightness, adding some releif (like rough heightfiled).
  • p6zaika - converts every single pixel into solid hexagonal prism. Prisms are packed into hexagonal grid (C6 symmetry) - a honey comb regular plane partition 63 - and scaled so that prism height is controlled by source image brightness, adding some releif (like rough heightfiled made of pencils).

Subfolders description - solid complex objects

  • superellipsoid/ - programs to convert every single pixel into superellipsoid. Placement similar to b4zaika(s); superellipsoid parameters are random. General effect is rather pop than artistic.

  • blob/ - programs converting every single pixel into blob component. Component (sphere) properties and blob threshold are easy to edit, resulting to quite impressive changes.

  • tori/ - programs for simulating canvas and cross-stitch.

Example of linen export rendering

Dependencies: Tkinter, PyPNG

Usage: programs are equipped with minimal GUI, so all you have to do after starting the programs is use standard "Open..." GUI to open image file, then use standard "Save..." GUI to set POVRay scene file to be created, then wait while program does the job, then open resulting POV file with POVRay and render the scene. Scene contains enough basic stuff (globals, light, camera) to be rendered successfully right after exporting without any editing.

Project website

Project mirrors:

github Dnyarri

gitflic Dnyarri