Tcl/Tk wrapper around Pixie, a full-featured 2D graphics library written in Nim.
- Tcl/Tk 8.6 (Only tested with Tcl/Tk 8.6.14).
- MacOS 14 x64
- Windows 10 x64
- Linux x64
Source distributions and binary packages can be downloaded here.
package require pix
# Init 'context' with size + color.
set ctx [pix::ctx::new {200 200} "white"]
# Style first rectangle.
pix::ctx::fillStyle $ctx "rgba(0, 0, 255, 0.5)" ; # blue
pix::ctx::fillRect $ctx {10 10} {100 100}
# Style second rectangle.
pix::ctx::fillStyle $ctx "rgba(255, 0, 0, 0.5)" ; # red
pix::ctx::fillRect $ctx {50 50} {100 100}
# Save context in a image file (*.png|*.bmp|*.qoi|*.ppm)
pix::ctx::writeFile $ctx rectangle.png
# Or display in label by example
set p [image create photo]
pix::drawSurface $ctx $p
label .l -image $p ; pack .l
See examples folder for more demos.
A large part of the pix
documentation comes from the Pixie API and source files.
- context
- font
- image
- paint
- path
- svg
- tclstubs-nimble (MIT)
- Pixie (MIT)
pix is covered under the terms of the MIT license.
- 03-Jun-2024 : 0.1
- Initial release.
- 25-Jun-2024 : 0.2
- Add
font
namespace + test file. - Add
image
namespace + test file. - Add
paint
namespace + test file. - Add
path
namespace + test file. - Rename
pix::ctx::getSize
bypix::ctx::get
- Rename
pix::img::read
bypix::img::readImage
- Rename
pix::font::read
bypix::font::readFont
- Add documentation based on Pixie API reference.
- Add binary for Linux.
- Code refactoring.
- Add
- 06-oct-2024 : 0.3
- Doc : Jpeg format is not supported for pix::ctx::writeFile.
- Rename
pix::parsePath
topix::pathObjToString
- Add
pix::svgStyleToPathObj
proc (convert SVG path string to path object) - Add
pix::rotMatrix
proc (matrix rotation) - Fix bug
pix::path::fillOverlaps
bad arguments, used. - Code refactoring.