Là một dự án mã nguồn mở, Zulko/gizeh đã đạt 725 sao trên GitHub, ngôn ngữ Python. Simple Vector Graphics for Python
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Gizeh is a Python library for vector graphics, built on top of cairocffi (Cairo bindings for Python). Cairo is powerful but low-level; Gizeh adds a small set of intuitive primitives to make drawing easier.
# Let's draw a red circle!
import gizeh
surface = gizeh.Surface(width=320, height=260) # pixels
circle = gizeh.circle(r=30, xy=[40, 40], fill=(1, 0, 0))
circle.draw(surface) # draw the circle on the surface
surface.write_to_png("circle.png") # export as PNG
See Gizeh in action (combined with MoviePy for animations) in
this blog post.
Gizeh supports Python 3.7+.
Installation
Gizeh requires the Cairo graphics library to be installed on your system.
macOS (Homebrew):
brew install cairo pkg-config
Debian/Ubuntu:
sudo apt-get install -y libcairo2-dev pkg-config
Then install the Python package:
pip install gizeh
Alternatively, from source (editable/development install):
pip install -e .
User Guide
This guide, along with the examples in gizeh/examples, should give you everything you need to get started. Check docstrings for details.
Surfaces
A Surface is a rectangle of fixed dimensions (in pixels) on which you draw elements, and which you can save/export as an image:
import gizeh
# initialize surface
surface = gizeh.Surface(width=320, height=260) # in pixels
# make a shape and draw it on the surface
circle = gizeh.circle(r=30, xy=[40, 40], fill=(1, 1, 1))
circle.draw(surface)
# export the surface
surface.get_npimage() # returns a (width x height x 3) numpy array
surface.write_to_png("circle.png")
Elements
Basic elements are circles, rectangles, lines, text, etc., that you draw on a surface using my_element.draw(surface). Common parameters:
xy: center coordinates of the object. At render time (surface.write_to_png) you can set y_origin to "top" (default) or "bottom". With "top", (0, 0) is the upper-left of the final image; the bottom-right is (width, height). With "bottom", (0, 0) is the bottom-left (like plots), and (width, height) is the top-right.
angle: rotation (radians) around xy.
fill: interior fill (default: none). Can be a color (R, G, B), gradient, image pattern, etc.
stroke: contour fill; same rules as fill.
stroke_width: contour width (pixels). Default is 0 (no stroke).
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Zulko/gizeh là nguồn chính thức.
Zulko/gizeh có bao nhiêu sao?
Zulko/gizeh có 725 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Zulko/gizeh. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Zulko/gizeh có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho Zulko/gizeh. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
Zulko/gizeh còn đang phát triển không?
Commit gần nhất trên Zulko/gizeh là 1.0 năm trước (theo timestamp GitHub). Repo có 68 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Zulko/gizeh là gì?
Zulko/gizeh (Zulko/gizeh) là dự án Python trên GitHub. Theo mô tả gốc: Simple Vector Graphics for Python
Zulko/gizeh viết bằng ngôn ngữ gì?
Zulko/gizeh chủ yếu viết bằng Python. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
gizeh có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về gizeh.