-
Notifications
You must be signed in to change notification settings - Fork 793
Features
Chris Kroells edited this page Sep 20, 2015
·
4 revisions
- Create high-quality thumbnails from existing images.
Large | Medium | Small | Method |
---|---|---|---|
Thumbnailator | |||
Graphics.drawImage |
- Option to embed a watermark (such as a logo) in the thumbnails.
- Transparency of the watermark is adjustable from transparent (0%) to opaque (100%).
20% opacity | 50% opacity | 80% opacity | 100% opacity |
---|---|---|---|
- Supports rotation of thumbnail.
0 deg. rotation | 90 deg. rotation | 180 deg. rotation | 270 deg. rotation | 45 deg. rotation |
---|---|---|---|---|
-
A fluent interface to simplify the process of making thumbnails programmatically.
For example, the code in the previous example for rotating thumbnails was written as follows:
for (int i : new int[] {0, 90, 180, 270, 45}) {
Thumbnails.of(new File("coobird.png"))
.size(100, 100)
.rotate(i)
.toFile(new File("image-rotated-" + i + ".png"));
}
- Multiple quality modes for thumbnail generation.
- Preserves the aspect ratio of resulting thumbnail, if desired.