-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Aravinda VK edited this page Aug 12, 2026
·
5 revisions
Chitra is a 2D graphics library written in D. It uses Cairo and the Pango C bindings. Chitra(ಚಿತ್ರ) means "Drawing" in the Kannada(Karnataka, INDIA) language.
import chitra;
void main()
{
auto ctx = Chitra(700);
with (ctx)
{
background(255); // white background
fill(0, 0, 255); // Fill blue color
rect(100, 100, 500, 200); // Draw Rectangle
saveAs("rect.png"); // Save as PNG image
}
}Thanks to the supporters who sponsored the Chitra project. If you use the Chitra project or are interested in helping it, a contribution would mean A LOT to me. With your help, I can continue my work sustainably. Thank you for your continued support!
- Generating 5mm dot pages using Chitra https://aravindavk.in/blog/5mm-dot-pages-using-chitra (Shared earlier in this forum; added here to keep the links together)
- Distance between two points https://aravindavk.in/blog/distance-between-two-points
- Tinted Images - Chitra https://aravindavk.in/blog/tinted-images
- Half-Tinted Magic: How to Add a Color Tint to Just Part of an Image https://aravindavk.in/blog/half-tinted-magic
- Perfect Fit Every Time: Automatically Resize Text https://aravindavk.in/blog/auto-resize-text-chitra
- Paper Elephant - Chitra https://aravindavk.in/blog/paper-elephant-chitra
- Highlight your Code with Chitra's New Syntax Highlighting Feature! https://aravindavk.in/blog/syntax-highlighting-chitra


