====== Java Image ====== * [[java:image/resize|java:image/resize]] * [[java:scrimage|scrimage]] ===== JAI - Java Advanced Imaging ===== * http://java.sun.com/javase/technologies/desktop/media/jai/ * [[http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/JAITOC.fm.html|Programming in Java Advanced Imaging]] * [[http://www.oracle.com/technetwork/java/current-142188.html|JAI Download]]. 전체 설치를 안하고 다음 두가지만 설치해도 된다. * [[http://mvnrepository.com/artifact/javax.media/jai_core|jai_core]] * [[http://mvnrepository.com/artifact/com.sun.media/jai_codec|jai_codec]] * 기본적으로 Native Library를 사용하도록 돼 있는데, 아래 설정을 통해 순수 Java로 사용가능. static { System.setProperty("com.sun.media.jai.disableMediaLib", "true"); } * [[http://jaitools.org/|JAITools]] ===== Image to BufferedImage ===== Image 객체를 BufferedImage 객체로 변환하는 방법 * [[http://www.exampledepot.com/egs/java.awt.image/Image2Buf.html|Creating a Buffered Image from an Image]] * [[http://www.exampledepot.com/egs/java.awt.image/HasAlpha.html|Determining If an Image Has Transparent Pixels]] : 위 방법에서 사용하는 hasAlpha 메소드 구현 ===== JAI Crop Image ===== * [[http://www.velocityreviews.com/forums/t146186-jai-example-of-cropping.html|JAI example of cropping]] RenderedImage ri = JAI.create(“fileload”,pathandfilename); public void crop() { pb = new ParameterBlock(); pb.addSource(ri); pb.add((float)topLeftmx); pb.add((float)topLeftmy); pb.add((float)roiWidth); pb.add((float)roiHeight); ri = JAI.create(“crop”,pb); } ===== imgscalr ===== * [[https://github.com/thebuzzmedia/imgscalr|imgscalr – Java Image Scaling Library]] ===== Twelvemonkeys ImageIO ===== * https://github.com/haraldk/TwelveMonkeys : ImageIO extension plugin ===== WebP ===== * [[https://github.com/lonnyj/webp-imageio|webp-imageio]]