Skip to content

Transforms

A transform modifies an image and returns a new image derived from that input. A transform is similar to a filter, but where a filter modifies the pixels of an image, a transform can return an entirely new image.

Click on an example to see it full screen.

Background Gradient

Produces a linear gradient background underlay for the two most dominent colours of an image.

ImmutableImage transformed = image1.transform(new BackgroundGradient(400, 300))
val transformed = image1.transform(BackgroundGradient(400, 300))
val transformed = image1.transform(new BackgroundGradient(400, 300))
Input Output

Tile

Tiles the source image into a larger image. TileTransform(columns, rows) produces an image columns times the source width and rows times the source height, with the source drawn into every cell — so TileTransform(3, 2) repeats the image 3 across and 2 down.

ImmutableImage transformed = image1.transform(new TileTransform(3, 2))
val transformed = image1.transform(TileTransform(3, 2))
val transformed = image1.transform(new TileTransform(3, 2))
Input Output