Class

com.sksamuel.scrimage

ParImage

Related Doc: package scrimage

Permalink

class ParImage extends MutableAwtImage

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ParImage
  2. MutableAwtImage
  3. AwtImage
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ParImage(awt: BufferedImage, metadata: ImageMetadata)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def affineTransform(tx: AffineTransform): BufferedImage

    Permalink

    Applies an affine transform in place.

    Applies an affine transform in place.

    Attributes
    protected[com.sksamuel.scrimage]
  5. def argb: Array[Array[Int]]

    Permalink

    Returns the ARGB components for all pixels in this image

    Returns the ARGB components for all pixels in this image

    returns

    an array containing ARGB components in that order.

    Definition Classes
    AwtImage
  6. def argb(x: Int, y: Int): Array[Int]

    Permalink

    Returns the ARGB components for the pixel at the given coordinates

    Returns the ARGB components for the pixel at the given coordinates

    x

    the x coordinate of the pixel component to grab

    y

    the y coordinate of the pixel component to grab

    returns

    an array containing ARGB components in that order.

    Definition Classes
    AwtImage
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def autocrop(color: Color)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Crops an image by removing cols and rows that are composed only of a single given color.

    Crops an image by removing cols and rows that are composed only of a single given color.

    Eg, if an image had a 20 pixel row of white at the top, and this method was invoked with Color.White then the image returned would have that 20 pixel row removed.

    This method is useful when images have an abudance of a single colour around them.

    color

    the color to match

  9. val awt: BufferedImage

    Permalink
    Definition Classes
    AwtImage
  10. final def blank(w: Int, h: Int, color: Option[Color] = None): ParImage

    Permalink

    Creates an empty image of the same concrete type as this type with the given dimensions.

    Creates an empty image of the same concrete type as this type with the given dimensions. If the optional color is specified then the background pixels will all be set to that color.

    Attributes
    protected[com.sksamuel.scrimage]
  11. def blank: ParImage

    Permalink

    Creates an empty Image with the same dimensions of this image.

    Creates an empty Image with the same dimensions of this image.

    returns

    a new Image that is a clone of this image but with uninitialized data

  12. def bound(width: Int, height: Int)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Returns an image that is no larger than the given width and height.

    Returns an image that is no larger than the given width and height.

    If the current image is already within the given dimensions then the same image will be returned. If not, then a scaled image, with the same aspect ratio as the original, and with dimensions inside the constraints will be returned.

    width

    the maximum width

    height

    the maximum height

    returns

    the constrained image.

  13. def brightness(factor: Double): ParImage

    Permalink

    Returns a new Image with the brightness adjusted.

  14. lazy val center: (Int, Int)

    Permalink

    The centre coordinates for the image as an (x, y) tuple.

    The centre coordinates for the image as an (x, y) tuple.

    Definition Classes
    AwtImage
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def col(x: Int): Array[Pixel]

    Permalink

    returns

    the pixels for the column identified by the x co-ordinate. 0 indexed.

    Definition Classes
    AwtImage
  17. def color(x: Int, y: Int): RGBColor

    Permalink

    Returns the color at the given coordinates.

    Returns the color at the given coordinates.

    returns

    the RGBColor value at the coords

    Definition Classes
    AwtImage
  18. def colours: Set[RGBColor]

    Permalink

    Returns a set of the distinct colours used in this image.

    Returns a set of the distinct colours used in this image.

    returns

    the set of distinct Colors

    Definition Classes
    AwtImage
  19. def composite(composite: Composite, applicative: Image): ParImage

    Permalink

    Apply the given image with this image using the given composite.

    Apply the given image with this image using the given composite. The original image is unchanged.

    composite

    the composite to use. See com.sksamuel.scrimage.Composite.

    applicative

    the image to apply with the composite.

    returns

    A new image with the given image applied using the given composite.

  20. def contains(color: Color): Boolean

    Permalink

    Returns true if a pixel with the given color exists

    Returns true if a pixel with the given color exists

    color

    the pixel colour to look for.

    returns

    true if there exists at least one pixel that has the given pixels color

    Definition Classes
    AwtImage
  21. def contrastInPlace(factor: Double): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    MutableAwtImage
  22. def copy: ParImage

    Permalink

    Creates a new image with the same data as this image.

    Creates a new image with the same data as this image. Any operations to the copied image will not write back to the original.

    returns

    A copy of this image.

  23. def count(p: (Pixel) ⇒ Boolean): Int

    Permalink

    Counts the number of pixels that are true for the given predicate

    Counts the number of pixels that are true for the given predicate

    p

    a predicate

    returns

    the number of pixels that evaluated true

    Definition Classes
    AwtImage
  24. def count(color: Color): Int

    Permalink

    Counts the number of pixels with the given colour.

    Counts the number of pixels with the given colour.

    color

    the colour to detect.

    returns

    the number of pixels that matched the colour of the given pixel

    Definition Classes
    AwtImage
  25. lazy val count: Int

    Permalink

    Returns the number of pixels in the image.

    Returns the number of pixels in the image.

    returns

    the number of pixels

    Definition Classes
    AwtImage
  26. def cover(targetWidth: Int, targetHeight: Int, scaleMethod: ScaleMethod = Bicubic, position: Position = Center)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Returns a copy of the canvas with the given dimensions where the original image has been scaled to completely cover the new dimensions whilst retaining the original aspect ratio.

    Returns a copy of the canvas with the given dimensions where the original image has been scaled to completely cover the new dimensions whilst retaining the original aspect ratio.

    If the new dimensions have a different aspect ratio than the old image then the image will be cropped so that it still covers the new area without leaving any background.

    targetWidth

    the target width

    targetHeight

    the target height

    scaleMethod

    the type of scaling method to use. Defaults to Bicubic

    position

    where to position the image inside the new canvas

    returns

    a new Image with the original image scaled to cover the new dimensions

  27. lazy val dimensions: (Int, Int)

    Permalink

    A tuple of the (width, height)

    A tuple of the (width, height)

    Definition Classes
    AwtImage
  28. def empty: AwtImage

    Permalink

    Returns a new AWT BufferedImage with the same dimensions and same AWT type.

    Returns a new AWT BufferedImage with the same dimensions and same AWT type. The data is uninitialized.

    Definition Classes
    AwtImage
  29. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. def equals(other: Any): Boolean

    Permalink
    Definition Classes
    AwtImage → AnyRef → Any
  31. def exists(p: (Pixel) ⇒ Boolean): Boolean

    Permalink

    Returns true if the predicate is true for at least one pixel on the image.

    Returns true if the predicate is true for at least one pixel on the image.

    p

    a predicate

    returns

    true if p holds for at least one pixel

    Definition Classes
    AwtImage
  32. def fastScaleAwt(targetWidth: Int, targetHeight: Int): BufferedImage

    Permalink

    Returns a new AWT Image scaled using nearest-neighbour.

    Returns a new AWT Image scaled using nearest-neighbour.

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    AwtImage
  33. def fastScaleScrimage(targetWidth: Int, targetHeight: Int): BufferedImage

    Permalink
    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    AwtImage
  34. def fill(color: Color = Color.White): ParImage

    Permalink

    Creates a new Image with the same dimensions of this image and with all the pixels initialized to the given color.

    Creates a new Image with the same dimensions of this image and with all the pixels initialized to the given color.

    returns

    a new Image with the same dimensions as this

  35. def fillInPlace(color: Color): Unit

    Permalink

    Fills all pixels the given color on the existing image.

    Fills all pixels the given color on the existing image.

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    MutableAwtImage
  36. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  37. def fit(canvasWidth: Int, canvasHeight: Int, color: Color = Color.Transparent, scaleMethod: ScaleMethod = Bicubic, position: Position = Center)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Returns a copy of this image with the given dimensions where the original image has been scaled to fit completely inside the new dimensions whilst retaining the original aspect ratio.

    Returns a copy of this image with the given dimensions where the original image has been scaled to fit completely inside the new dimensions whilst retaining the original aspect ratio.

    canvasWidth

    the target width

    canvasHeight

    the target height

    color

    the color to use as the "padding" colour should the scaled original not fit exactly inside the new dimensions

    scaleMethod

    the algorithm to use for the scaling operation. See ScaleMethod.

    position

    where to position the image inside the new canvas

    returns

    a new Image with the original image scaled to fit inside

  38. def flipX: ParImage

    Permalink

    Flips this image horizontally.

    Flips this image horizontally.

    returns

    The result of flipping this image horizontally.

  39. def flipY: ParImage

    Permalink

    Flips this image vertically.

    Flips this image vertically.

    returns

    The result of flipping this image vertically.

  40. def forall(f: (Int, Int, Pixel) ⇒ Boolean): Boolean

    Permalink

    Returns true if the predicate is true for all pixels in the image.

    Returns true if the predicate is true for all pixels in the image.

    f

    a predicate function that accepts 3 parameters - the x,y coordinate and the pixel at that coordinate

    returns

    true if f holds for at least one pixel

    Definition Classes
    AwtImage
  41. def foreach(f: (Int, Int, Pixel) ⇒ Unit): Unit

    Permalink

    Executes the given side effecting function on each pixel.

    Executes the given side effecting function on each pixel.

    f

    a function that accepts 3 parameters - the x,y coordinate and the pixel at that coordinate

    Definition Classes
    AwtImage
  42. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  43. def hashCode(): Int

    Permalink
    Definition Classes
    AwtImage → AnyRef → Any
  44. lazy val height: Int

    Permalink
    Definition Classes
    AwtImage
  45. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  46. def iterator: Iterator[Pixel]

    Permalink

    Returns the pixels of the image as an iterator.

    Returns the pixels of the image as an iterator. The iterator is the most efficient way to lazily iterator over the pixels as the pixels will only be fetched from the raster as needed.

    returns

    the iterator

    Definition Classes
    AwtImage
  47. def map(f: (Int, Int, Pixel) ⇒ Pixel): ParImage

    Permalink

    Maps the pixels of this image into another image by applying the given function to each pixel.

    Maps the pixels of this image into another image by applying the given function to each pixel.

    The function accepts three parameters: x,y,p where x and y are the coordinates of the pixel being transformed and p is the pixel at that location.

    f

    the function to transform pixel x,y with existing value p into new pixel value p' (p prime)

  48. def mapInPlace(f: (Int, Int, Pixel) ⇒ Pixel): Unit

    Permalink

    Maps the pixels of this image into another image by applying the given function to each pixel.

    Maps the pixels of this image into another image by applying the given function to each pixel.

    The function accepts three parameters: x,y,p where x and y are the coordinates of the pixel being transformed and p is the pixel at that location.

    f

    the function to transform pixel x,y with existing value p into new pixel value p' (p prime)

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    MutableAwtImage
  49. def max(maxW: Int, maxH: Int)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Returns a new image that is scaled to fit the specified bounds while retaining the same aspect ratio as the original image.

    Returns a new image that is scaled to fit the specified bounds while retaining the same aspect ratio as the original image. The dimensions of the returned image will be the same as the result of the scaling operation. That is, no extra padding will be added to match the bounded width and height. For an operation that will scale an image as well as add padding to fit the dimensions perfectly, then use fit()

    Requesting a bound of 200,200 on an image of 300,600 will result in a scale to 100,200. Eg, the original image will be scaled down to fit the bounds.

    Requesting a bound of 150,200 on an image of 150,150 will result in the same image being returned. Eg, the original image cannot be scaled up any further without exceeding the bounds.

    Requesting a bound of 300,300 on an image of 100,150 will result in a scale to 200,300.

    Requesting a bound of 100,1000 on an image of 50,50 will result in a scale to 100,100.

    maxW

    the maximum width

    maxH

    the maximum height

    returns

    A new image that is the result of the binding.

  50. val metadata: ImageMetadata

    Permalink
  51. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  52. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  53. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  54. def offset(x: Int, y: Int): Int

    Permalink
    Definition Classes
    AwtImage
  55. def op(op: BufferedImageOp): ParImage

    Permalink
    Attributes
    protected[com.sksamuel.scrimage]
  56. def overlay(overlayImage: AwtImage, x: Int = 0, y: Int = 0): ParImage

    Permalink

    Returns a new image that is the result of overlaying the given image over this image.

    Returns a new image that is the result of overlaying the given image over this image. That is, the existing image ends up being "under" the image parameter. The x / y parameters determine where the (0,0) coordinate of the overlay should be placed.

    If the image to render exceeds the boundaries of the source image, then the excess pixels will be ignored.

    returns

    a new Image with the given image overlaid.

  57. def overlayInPlace(overlay: BufferedImage, x: Int = 0, y: Int = 0): Unit

    Permalink

    Applies the given image over the current buffer.

    Applies the given image over the current buffer.

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    MutableAwtImage
  58. def pad(size: Int, color: Color = Color.Transparent): ParImage

    Permalink

    Creates a new image which is the result of this image padded with the given number of pixels on each edge.

    Creates a new image which is the result of this image padded with the given number of pixels on each edge.

    Eg, requesting a pad of 30 on an image of 250,300 will result in a new image with a canvas size of 310,360

    size

    the number of pixels to add on each edge

    color

    the background of the padded area.

    returns

    A new image that is the result of the padding

  59. def padTo(targetWidth: Int, targetHeight: Int, color: Color = Color.Transparent): ParImage

    Permalink

    Creates a new image which is the result of this image padded to the canvas size specified.

    Creates a new image which is the result of this image padded to the canvas size specified. If this image is already larger than the specified pad then the sizes of the existing image will be used instead.

    Eg, requesting a pad of 200,200 on an image of 250,300 will result in keeping the 250,300.

    Eg2, requesting a pad of 300,300 on an image of 400,250 will result in the width staying at 400 and the height padded to 300.

    targetWidth

    the size of the output canvas width

    targetHeight

    the size of the output canvas height

    color

    the background of the padded area.

    returns

    A new image that is the result of the padding

  60. def padWith(left: Int, top: Int, right: Int, bottom: Int, color: Color = Color.Transparent): ParImage

    Permalink

    Creates a new image by adding the given number of columns/rows on left, top, right and bottom.

    Creates a new image by adding the given number of columns/rows on left, top, right and bottom.

    left

    the number of columns/pixels to add on the left

    top

    the number of rows/pixels to add to the top

    right

    the number of columns/pixels to add on the right

    bottom

    the number of rows/pixels to add to the bottom

    color

    the background of the padded area.

    returns

    A new image that is the result of the padding operation.

  61. def patch(x: Int, y: Int, patchWidth: Int, patchHeight: Int): Array[Pixel]

    Permalink
    Definition Classes
    AwtImage
  62. def patches(patchWidth: Int, patchHeight: Int): IndexedSeq[() ⇒ Array[Pixel]]

    Permalink

    Returns all the patches of a given size in the image, assuming pixel alignment (no subpixel extraction).

    Returns all the patches of a given size in the image, assuming pixel alignment (no subpixel extraction).

    The patches are returned as a sequence of pixel matrices closures

    Definition Classes
    AwtImage
  63. def pixel(p: (Int, Int)): Pixel

    Permalink

    Returns the pixel at the given coordinate.

    Returns the pixel at the given coordinate.

    p

    the pixel as an integer tuple

    returns

    the pixel

    Definition Classes
    AwtImage
  64. def pixel(x: Int, y: Int): Pixel

    Permalink

    Returns the pixel at the given coordinates.

    Returns the pixel at the given coordinates.

    x

    the x coordinate of the pixel to grab

    y

    the y coordinate of the pixel to grab

    returns

    the Pixel at the location

    Definition Classes
    AwtImage
  65. def pixels(x: Int, y: Int, w: Int, h: Int): Array[Pixel]

    Permalink

    Returns a rectangular region within the given boundaries as a single dimensional array of integers.

    Returns a rectangular region within the given boundaries as a single dimensional array of integers.

    Eg, pixels(10, 10, 30, 20) would result in an array of size 600 with the first row of the region in indexes 0,..,29, second row 30,..,59 etc.

    x

    the start x coordinate

    y

    the start y coordinate

    w

    the width of the region

    h

    the height of the region

    returns

    an Array of pixels for the region

    Definition Classes
    AwtImage
  66. def pixels: Array[Pixel]

    Permalink

    Returns all the pixels for the image

    Returns all the pixels for the image

    returns

    an array of pixels for this image

    Definition Classes
    AwtImage
  67. lazy val points: Seq[(Int, Int)]

    Permalink
    Definition Classes
    AwtImage
  68. lazy val radius: Int

    Permalink

    The radius of the image defined as the centre to the corners.

    The radius of the image defined as the centre to the corners.

    Definition Classes
    AwtImage
  69. lazy val ratio: Double

    Permalink

    returns

    Returns the aspect ratio for this image.

    Definition Classes
    AwtImage
  70. def removeTransparency(color: java.awt.Color): ParImage

    Permalink
  71. def removeTransparency(color: Color): ParImage

    Permalink

    Returns a new image with the transparency replaced with the given color.

    Returns a new image with the transparency replaced with the given color.

    returns

    a new image with the transparency replaced.

  72. def removetrans(color: java.awt.Color): Unit

    Permalink
    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    MutableAwtImage
  73. def rescaleInPlace(factor: Double): Unit

    Permalink

    Mutates this image by scaling all pixel values by the given factor (brightness in other words).

    Mutates this image by scaling all pixel values by the given factor (brightness in other words).

    Attributes
    protected
    Definition Classes
    MutableAwtImage
  74. def resize(scaleFactor: Double, position: Position = Center, background: Color = Color.Transparent): ParImage

    Permalink

    Resize will resize the canvas, it will not scale the image.

    Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.

    scaleFactor

    the scaleFactor. 1 retains original size. 0.5 is half. 2 double. etc

    position

    where to position the original image after the canvas size change. Defaults to centre.

    background

    the color to use for expande background areas. Defaults to White.

    returns

    a new Image that is the result of resizing the canvas.

  75. def resizeTo(targetWidth: Int, targetHeight: Int, position: Position = Center, background: Color = Color.Transparent): ParImage

    Permalink

    Resize will resize the canvas, it will not scale the image.

    Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.

    If the dimensions are smaller than the current canvas size then the image will be cropped.

    The position parameter determines how the original image will be positioned on the new canvas.

    targetWidth

    the target width

    targetHeight

    the target height

    position

    where to position the original image after the canvas size change

    background

    the background color if the canvas was enlarged

    returns

    a new Image that is the result of resizing the canvas.

  76. def resizeToHeight(targetHeight: Int, position: Position = Center, background: Color = Color.Transparent): ParImage

    Permalink

    Resize will resize the canvas, it will not scale the image.

    Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.

    position

    where to position the original image after the canvas size change

    returns

    a new Image that is the result of resizing the canvas.

  77. def resizeToWidth(targetWidth: Int, position: Position = Center, background: Color = Color.Transparent): ParImage

    Permalink

    Resize will resize the canvas, it will not scale the image.

    Resize will resize the canvas, it will not scale the image. This is like a "canvas resize" in Photoshop.

    position

    where to position the original image after the canvas size change

    returns

    a new Image that is the result of resizing the canvas.

  78. def rgb: Array[Array[Int]]

    Permalink
    Definition Classes
    AwtImage
  79. def rgb(x: Int, y: Int): Array[Int]

    Permalink
    Definition Classes
    AwtImage
  80. def rotate(angle: Double): BufferedImage

    Permalink

    Returns a new AWT Image rotated with the given angle (in degrees)

    Returns a new AWT Image rotated with the given angle (in degrees)

    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    AwtImage
  81. def rotateLeft: ParImage

    Permalink

    Returns a copy of this image rotated 90 degrees anti-clockwise (counter clockwise to US English speakers).

  82. def rotateRight: ParImage

    Permalink

    Returns a copy of this image rotated 90 degrees clockwise.

  83. def row(y: Int): Array[Pixel]

    Permalink

    returns

    the pixels in the row identified by the y coordinate. 0 indexed.

    Definition Classes
    AwtImage
  84. def scale(scaleFactor: Double, scaleMethod: ScaleMethod = Bicubic)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Scale will resize the canvas and the image.

    Scale will resize the canvas and the image. This is like a "image resize" in Photoshop.

    scaleFactor

    the target increase or decrease. 1 is the same as original.

    scaleMethod

    the type of scaling method to use.

    returns

    a new Image that is the result of scaling this image

  85. def scale(targetWidth: Int, targetHeight: Int, scale: Scale): BufferedImage

    Permalink
    Attributes
    protected[com.sksamuel.scrimage]
    Definition Classes
    AwtImage
  86. def scaleTo(targetWidth: Int, targetHeight: Int, scaleMethod: ScaleMethod = Bicubic)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Scale will resize both the canvas and the image.

    Scale will resize both the canvas and the image. This is like a "image resize" in Photoshop.

    The size of the scaled instance are taken from the given width and height parameters.

    targetWidth

    the target width

    targetHeight

    the target height

    scaleMethod

    the type of scaling method to use. Defaults to SmoothScale

    returns

    a new Image that is the result of scaling this image

  87. def scaleToHeight(targetHeight: Int, scaleMethod: ScaleMethod = Bicubic)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Scale will resize the canvas and scale the image to match.

    Scale will resize the canvas and scale the image to match. This is like a "image resize" in Photoshop.

    scaleToHeight will scale the image so that the new image has a height that matches the given targetHeight and the same aspect ratio as the original.

    Eg, an image of 200,300 with a scaleToHeight of 450 will result in a scaled image of 300,450

    targetHeight

    the target height

    scaleMethod

    the type of scaling method to use.

    returns

    a new Image that is the result of scaling this image

  88. def scaleToWidth(targetWidth: Int, scaleMethod: ScaleMethod = Bicubic)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Scale will resize the canvas and scale the image to match.

    Scale will resize the canvas and scale the image to match. This is like a "image resize" in Photoshop.

    scaleToWidth will scale the image so that the new image has a width that matches the given targetWidth and the height is determined by the original aspect ratio.

    Eg, an image of 200,300 with a scaleToWidth of 400 will result in a scaled image of 400,600

    targetWidth

    the target width

    scaleMethod

    the type of scaling method to use.

    returns

    a new Image that is the result of scaling this image

  89. def setPixel(x: Int, y: Int, pixel: Pixel): Unit

    Permalink
    Definition Classes
    MutableAwtImage
  90. def subimage(x: Int, y: Int, w: Int, h: Int): ParImage

    Permalink

    Returns a new Image that is a subimage or region of the original image.

    Returns a new Image that is a subimage or region of the original image.

    x

    the start x coordinate

    y

    the start y coordinate

    w

    the width of the subimage

    h

    the height of the subimage

    returns

    a new Image that is the subimage

  91. def subpixel(x: Double, y: Double): Int

    Permalink

    Uses linear interpolation to get a sub-pixel.

    Uses linear interpolation to get a sub-pixel.

    Legal values for x and y are in [0, width) and [0, height), respectively.

    Definition Classes
    AwtImage
  92. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  93. def toImage: Image

    Permalink
  94. def toNewBufferedImage(type: Int = awt.getType): BufferedImage

    Permalink

    Returns a new AWT BufferedImage from this image.

    Returns a new AWT BufferedImage from this image.

    type

    the type of buffered image to create, if not specified then defaults to the current image type

    returns

    a new, non-shared, BufferedImage with the same data as this Image.

    Definition Classes
    AwtImage
  95. def toString(): String

    Permalink
    Definition Classes
    AwtImage → AnyRef → Any
  96. def translate(x: Int, y: Int, background: Color = Color.Transparent): ParImage

    Permalink

    Returns an image that is the result of translating the image while keeping the same view window.

    Returns an image that is the result of translating the image while keeping the same view window. Eg, if translating by 10,5 then all pixels will move 10 to the right, and 5 down. This would mean 10 columns and 5 rows of background added to the left and top.

    returns

    a new Image with this image translated.

  97. def trim(left: Int, top: Int, right: Int, bottom: Int): ParImage

    Permalink

    Removes the given amount of pixels from each edge; like a crop operation.

    Removes the given amount of pixels from each edge; like a crop operation.

    left

    the number of pixels to trim from the left

    top

    the number of pixels to trim from the top

    right

    the number of pixels to trim from the right

    bottom

    the number of pixels to trim from the bottom

    returns

    a new Image with the dimensions width-trim*2, height-trim*2

  98. def trim(amount: Int): ParImage

    Permalink

    Removes the given amount of pixels from each edge; like a crop operation.

    Removes the given amount of pixels from each edge; like a crop operation.

    amount

    the number of pixels to trim from each edge

    returns

    a new Image with the dimensions width-trim*2, height-trim*2

  99. def underlay(underlayImage: Image, x: Int = 0, y: Int = 0): ParImage

    Permalink

    Returns a new Image that is the result of overlaying this image over the supplied image.

    Returns a new Image that is the result of overlaying this image over the supplied image. That is, the existing image ends up being "on top" of the image parameter. The x / y parameters determine where the (0,0) coordinate of the overlay should be placed.

    If the image to render exceeds the boundaries of the source image, then the excess pixels will be ignored.

    returns

    a new Image with the given image overlaid.

  100. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  101. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  102. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  103. lazy val width: Int

    Permalink
    Definition Classes
    AwtImage
  104. def wrapAwt(awt: BufferedImage, metadata: ImageMetadata): ParImage

    Permalink
    Attributes
    protected[com.sksamuel.scrimage]
  105. def wrapPixels(w: Int, h: Int, pixels: Array[Pixel], metadata: ImageMetadata): ParImage

    Permalink
    Attributes
    protected[com.sksamuel.scrimage]
  106. def zoom(factor: Double, method: ScaleMethod = ScaleMethod.Bicubic)(implicit executor: ExecutionContext): Future[ParImage]

    Permalink

    Returns a new image that is the result of scaling this image but without changing the canvas size.

    Returns a new image that is the result of scaling this image but without changing the canvas size.

    This can be thought of as zooming in on a camera - the viewpane does not change but the image increases in size with the outer columns/rows being dropped as required.

    factor

    how much to zoom by

    method

    how to apply the scaling method

    returns

    the zoomed image

Inherited from MutableAwtImage

Inherited from AwtImage

Inherited from AnyRef

Inherited from Any

Ungrouped