Questions tagged [scrimage]

Scrimage is a Scala image library for manipulating and processing of images. The aim of the this library is to provide a quick and easy way to do the kinds of image operations that most people need, such as scaling, rotating, converting between formats and applying filters. It is not intended to provide functionality that might be required by a more "serious" image application - such as face recognition or movement tracking.

Scrimage is a Scala image library for manipulating and processing of images. The aim of the this library is to provide a quick and easy way to do the kinds of image operations that most people need, such as scaling, rotating, converting between formats and applying filters. It is not intended to provide functionality that might be required by a more "serious" image application - such as face recognition or movement tracking.

A typical use case for this library would be creating thumbnails of images uploaded by users in a web app, or resizing a set of images to have a consistent size, or optimizing PNG uploads by users to apply maximum compression, or applying a grayscale filter in a print application.

Scrimage has a consistent, idiomatic scala, and mostly immutable API that builds on the java.awt.Image methods. I say mostly immutable because for some operations creating a copy of the underlying image would prove expensive (think an in place filter on a 8000 x 6000 image where you do not care about keeping the original in memory). For these kinds of operations Scrimage supports a MutableImage instance where operations that can be performed in place mutate the original instead of returning a copy.

6 questions
2
votes
1 answer

Awaiting all Scala Futures to complete

I have a for comprehension like this using an image library that supports concurrent operations https://github.com/sksamuel/scrimage : for ( file <- myDirectory.listFiles; image <- AsyncImage(file); scaled <- image.scale(0.5) …
bonez
  • 685
  • 1
  • 16
  • 39
2
votes
1 answer

Trying to make use of Jcrop and serverside image resizing with scala Scrimage lib

I'm trying to combine jcrop and scrimage but I'm having trouble in understanding the documentation of scrimage. The user uploads an image. When the upload is done the user is able choose a fixed area to crop with Jcrop: upload.js $(function…
jakob
  • 5,979
  • 7
  • 64
  • 103
1
vote
1 answer

Get bufferedImage image from URL with sksamuel/scrimage

I would like to ask if is correct way of using it when I want to save file in memory from writer and convert it to BufferedImage or should i write it to outputstream and convert it to BufferedImage? Link to documentation…
Marius
  • 151
  • 5
1
vote
1 answer

Scala image compression and optimisation

I've been looking into Scala/Java based image compression and optimisation libraries and https://github.com/sksamuel/scrimage looked like a good choice until I found that the documentation was incorrect and got no support whatsoever from their…
Ashesh
  • 2,978
  • 4
  • 27
  • 47
1
vote
1 answer

Get image format from Scrimage Image instance

I'm working with scrimage right now, and I need to get the image format from the file, as right now, if a GIF is uploaded, it will not become an animated JPEG. I need to be able to tell if the image file is a GIF so I know to not use the Format.JPEG…
Wiz
  • 4,595
  • 9
  • 34
  • 51
0
votes
1 answer

Need help understanding Scala Futures with Scrimage image package

I'm trying to wrap my head around futures, and have a little sample of scaling a directory of images going... Can some explain to me how this should work? import com.sksamuel.scrimage._ import scala.concurrent._ import…
bonez
  • 685
  • 1
  • 16
  • 39