graphics - Using Java AWT to generate monochrome 1bitpp PNG with Ancillary Chunks -


i trying generate png following ancillary chunks (header reference image) enter image description here

the ancillary chunks in reference image came gimp processing.

whereas image generate java awt not have ancillary chunks.
here header of png generating. please note critical chunks identical.

enter image description here

here code fragment

{         :          // color map contains colors black , white         byte[] cmap = {0, 0, 0, (byte)255, (byte)255, (byte)255};         // create indexcolormodel setting white transparent color         indexcolormodel monochrome = new indexcolormodel(8, 2, cmap, 0, false, 0);         bufferedimage img = new bufferedimage(width_img, height_img,                   bufferedimage.type_byte_indexed,monochrome);         graphics2d g2d = img.creategraphics();          :                     g2d.setcolor(color.white);         g2d.fillrect(0, 0, width_img, height_img);          font font = new font("arial bold", font.plain, 48);         g2d.setfont(font);         fontmetrics fm = g2d.getfontmetrics();         g2d.setcolor(color.black);         :         :          g2d.dispose();          imgname = ".\\panel"+width_img+"x"+height_img+".png";         imageio.write(img, "png", new file(imgname));        : } 

how add chunks (phys, time) using java awt?

any pointers helpful too- please let me know.

thank you

i concluded awt not support - questions identifies couple of ways add chunks how can save png text or itxt chunk java?

here propose -

use awt / graphics 2d generate .png

read png, refer link details on how

add chunks want add

write it(them) .png


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -