スキップしてメイン コンテンツに移動

投稿

ラベル(pngj)が付いた投稿を表示しています

Java: Create Index PNG Using PNGJ 2.1.1

Introduction I have written java code for generating indexed png using pngj version 0.94. Now pngj version 2.1.1 has been released on 2014/6/1. So I have refined the code for generating indexed png so that the code suits with pngj version 2.1.1. Code package com.dukesoftware.utils.image.pngj; import ar.com.hjg.pngj.IImageLine; import ar.com.hjg.pngj.ImageInfo; import ar.com.hjg.pngj.ImageLineInt; import ar.com.hjg.pngj.PngReader; import ar.com.hjg.pngj.PngWriter; import ar.com.hjg.pngj.chunks.ChunkCopyBehaviour; import ar.com.hjg.pngj.chunks.PngChunkSingle; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; public final class PngUtils { private static final int _1K_BYTES = 1024; public static void toIndexed256Colors(File input, File output) throws IOException { PngReader png1 = new PngReader(input); ImageInfo pnginfo1 = png1.imgInf