This is the kind of thing you want to use a library for, most likely the Java 2D API. It includes facilities for fills, strokes, transforms, and filters. Its model is similar to many libraries in that you trace out a path with operators moveTo
and lineTo
or curveTo
, which are abstracted in shapes like Ellipse2D
; and then you fill or stroke the resultant path with a paint operator. I highly recommend reading the Java 2D tutorial and understanding how the different parts fit together.
I would take roughly the following steps to create this drawing:
- Compute the final dimensions of the rotated ellipse after blurring.
- Create a
BuferredImage
of that size and call its createGraphics
method to acquire a drawing context.
- Rotate the graphics object
- Draw the ellipse
- Fill it with black
- Implement the Gaussian blur filter. This is not built in to the API, but it includes a framework for doing filters called
ConvolveOp
, and you can find an algorithm for computing the Gaussian kernel in Java.
- Apply the filter to the image, and then return the results.
Another option might be Apache’s Batik SVG library, since you can declaratively express the drawing you want (including transformations and filters) and have it rasterized for you.