Java BufferedImage Operation duplicateImage(BufferedImage image)

Here you can find the source of duplicateImage(BufferedImage image)

Description

duplicate Image

License

Apache License

Declaration

public static BufferedImage duplicateImage(BufferedImage image) 

Method Source Code

//package com.java2s;
/*/*www.  j  a v  a  2s. c om*/
 * Copyright 2005 Tom Gibara
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
    
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */

import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage duplicateImage(BufferedImage image) {
        BufferedImage dup = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());
        image.copyData(dup.getWritableTile(0, 0));
        dup.releaseWritableTile(0, 0);
        return dup;
    }
}

Related

  1. depalettize(BufferedImage img, int maxBytes)
  2. determineBackgroundColor(BufferedImage bim)
  3. doInGraphics(final BufferedImage image, final Consumer consumer)
  4. duplicate(BufferedImage image)
  5. DuplicateBufferedImage(BufferedImage bi)
  6. dye(BufferedImage image, Color color)
  7. ensureIntRGB(final BufferedImage img)
  8. ensureRGBAImage(BufferedImage img)
  9. fadeImageByShape(BufferedImage bimg, Shape arbshape, double alpha, int rule)