Java BufferedImage Crop zealousSubsCrop(BufferedImage img)

Here you can find the source of zealousSubsCrop(BufferedImage img)

Description

zealous Subs Crop

License

Open Source License

Declaration

public static BufferedImage zealousSubsCrop(BufferedImage img) 

Method Source Code

//package com.java2s;
/**//from www.jav a2s  .co  m
 *  This file is part of SmallNN, a small neural network implementation
 *  Copyright (C) 2011, 2012 Arsen Kostenko <arsen.kostenko@gmail.com>
 *     
 *  SmallNN is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  SmallNN is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with SmallNN.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage zealousSubsCrop(BufferedImage img) {
        int initialHeight = img.getHeight();
        int initialWidth = img.getWidth();
        int newHeight = initialHeight / 2;
        int newWidth = initialWidth / 2;
        return img.getSubimage(newWidth / 2, newHeight, newWidth, newHeight);
    }
}

Related

  1. divideImage(BufferedImage bi, int rows, int cols, int width, int height)
  2. doCrop(BufferedImage bufferedImage, int cropX, int cropY, int width, int height)
  3. drawCropped(JPanel contentPane, ActionListener listener, BufferedImage img, int type, int sx1, int sy1, int sx2, int sy2, int x, int y, int scale)
  4. ImageCrop(String sourcePath, String descPath, int cropX, int cropY, int width, int height)
  5. imgUtilFastCrop(BufferedImage src, int x, int y, int width, int height)