Class ImageUtils.Pipeline

    • Field Detail

      • image

        public final BufferedImage image
        The encapsulated image in this pipeline.
    • Method Detail

      • from

        public static ImageUtils.Pipeline from​(BufferedImage image)
        Starts an image processing pipeline.
        Parameters:
        image - the image to process
        Returns:
        a processing pipeline
      • from

        public static ImageUtils.Pipeline from​(InputStream input)
        Starts an image processing pipeline.
        Parameters:
        input - input stream providing the image to process
        Returns:
        a processing pipeline
      • into

        public <OUTPUT extends OutputStream> OUTPUT into​(OUTPUT output,
                                                         String format)
        Ends the image processing pipeline.
        Type Parameters:
        OUTPUT - type of output stream
        Parameters:
        output - the output stream to serialize into
        format - informal image format label
        Returns:
        the filled output stream; useful with in-memory streams (e.g. ByteArrayOutputStream
      • into

        public <OUTPUT extends OutputStream> OUTPUT into​(Supplier<OUTPUT> outputSupplier,
                                                         String format)
        Ends the image processing pipeline.
        Type Parameters:
        OUTPUT - type of output stream
        Parameters:
        outputSupplier - the output stream to serialize into; will be closed automatically
        format - informal image format label
        Returns:
        the filled output stream; useful with in-memory streams (e.g. ByteArrayOutputStream
      • reduce

        public ImageUtils.Pipeline reduce​(IndexColorModel indexColorModel)
        Reduces the color palette per specified model.
        Parameters:
        indexColorModel - the color model to apply
        Returns:
        this pipeline
      • scale

        public ImageUtils.Pipeline scale​(double widthScale,
                                         double heightScale)
        Scales by specified factors.

        Good quality when scaling down.

        Parameters:
        widthScale - the width scale factor
        heightScale - the height scale factor
        Returns:
        this pipeline
      • diff

        public <D> D diff​(BufferedImage other,
                          Function<org.apache.commons.lang3.tuple.Pair<BufferedImage,​BufferedImage>,​D> differentiator)
        Difference between this image and other image.
        Type Parameters:
        D - type of difference
        Parameters:
        other - image to find difference from
        differentiator - a differentiating method
        Returns:
        the difference