You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Convolution is useful for image processing tasks, such as smoothing and edge detection, as well as being a creative tool. An example of what can be achieved using convolutions, and other image processing effects, is given at https://www.smashingmagazine.com/2015/05/why-the-svg-filter-is-awesome/
The goal of this task is to add convolutions to Doodle. Both Java2D and SVG support convolutions, but in different ways. Thus this task requires some API design work. For example, it might make more sense to have different algebras for the different backends.
Details
Convolutions typically apply to rectangular bitmaps, while pictures in Doodle can have arbitrary boundaries and are usually represented a vector shapes, not bitmaps. This means there are several implementation options:
Convolutions apply to an entire Canvas and cannot be applied to individual elements. A convolution is only applied once a Picture is rendered to screen and applies to everything that is rendered.
Convolutions apply to individual elements (a Picture). On the Java2D backend this will require rendering an element to a bitmap buffer, performing the convolution, and then rendering the bitmap ("compositing") back into the main image. In SVG this is directly supported.
Overview
Convolution is useful for image processing tasks, such as smoothing and edge detection, as well as being a creative tool. An example of what can be achieved using convolutions, and other image processing effects, is given at https://www.smashingmagazine.com/2015/05/why-the-svg-filter-is-awesome/
The goal of this task is to add convolutions to Doodle. Both Java2D and SVG support convolutions, but in different ways. Thus this task requires some API design work. For example, it might make more sense to have different algebras for the different backends.
Details
Convolutions typically apply to rectangular bitmaps, while pictures in Doodle can have arbitrary boundaries and are usually represented a vector shapes, not bitmaps. This means there are several implementation options:
Canvas
and cannot be applied to individual elements. A convolution is only applied once aPicture
is rendered to screen and applies to everything that is rendered.Picture
). On the Java2D backend this will require rendering an element to a bitmap buffer, performing the convolution, and then rendering the bitmap ("compositing") back into the main image. In SVG this is directly supported.Picture
toBufferedImage
#87, and Add "immediate mode" algebra ("Doodle Canvas") #93 for related issues) on which convolutions are applied, and then methods to transform this bitmap to and from aPicture
. This achieves the same effect as 2 but is more explicit and will be difficult to support on SVG.A convolution algebra may look something like the below. This example corresponds to option 3 above, with an explicit representation of a
Bitmap
.See backend specific details:
A few notes:
See #85 for a related issue.
The text was updated successfully, but these errors were encountered: