Is there any good Scala or Java library for image manipulation? For simple tasks like composing an image with some others then generating a thumb?
5 Answers
Take a look at https://github.com/sksamuel/scrimage (Disclaimer: I am the author)
This is an open source Scala image library that essentially wraps java.awt Image operations in a nicer API.
You asked how to generate a thumbnail, you would do something like.
val in = ...// some input stream
val out = ... // some output stream
Image(in).scale(300,400).write(out, Png)
You can change the scaling method (Bicubic by default) and the output format.

- 16,154
- 8
- 60
- 108
they're all a bit old school, and maybe inconvenient, but java.awt, java.awt.image, and javax.imageio has everything you need to blend and rescale images. You can find some blending example code e.g. here
http://www.curious-creature.org/2006/09/20/new-blendings-modes-for-java2d/
you can find some examples of rescaling and generating image bytes e.g. here
https://sourceforge.net/projects/ssim/?source=directory
there are probably newer/easier solutions, but these do work.

- 13,689
- 1
- 35
- 45
Since the question is tag with java-2d
you know you can use any Java library. A quick google revealed this SO answer:

- 1
- 1

- 12,763
- 1
- 38
- 49