A Java library for programmatically creating images composed of various geometrical shapes. Generate beautiful artwork using points, lines, circles, rectangles, and triangles with automatic random coloring.
- Multiple Shape Types: Points, Lines, Circles, Rectangles, Triangles
- Automatic Random Colors: Each shape gets a unique random color
- High-Quality Rendering: Uses Bresenham's line algorithm for crisp, pixel-perfect lines
- Flexible API: Object-oriented design with interfaces for extensibility
- Image Export: Save your creations as PNG files
- Random Generators: Built-in methods to create random shapes within specified bounds
jart/
βββ geometrical_shapes/
β βββ Displayable.java # Interface for drawable surfaces
β βββ Drawable.java # Interface for drawable shapes
β βββ Image.java # Canvas implementation
β βββ Point.java # Point shape
β βββ Line.java # Line shape using Bresenham's algorithm
β βββ Circle.java # Circle shape
β βββ Rectangle.java # Rectangle shape
β βββ Triangle.java # Triangle shape
βββ Main.java # Example usage
βββ README.md # This file
βββ .gitignore # Git ignore rules
- Java 17 or higher
- Any Java IDE or command line tools
# Compile the project
javac -d build Main.java
# Run the example
java -cp build Main
# View the generated image
# Opens image.png in your default image viewer