png - Change the format of an Image in java without saving -
i read image , change format without saving it.
for example can read image this
bufferedimage img=imageio.read(new file(filename));
then want change format of img
, example jpeg png. way found use imageio.read
write , read new image, seem efficient way it.
when "read" image via
bufferedimage img=imageio.read(new file('myimage.png'));
you not reading decoding it, i.e., transforming raw bytes in (say) png format "raw" format aplication or api can manipulate (or display) - in case, bufferedimage
. once done, fact image came png file forgotten. read png , save jpeg need decode (as png) , code (as jpg).
i read image , change format without saving it.
the "format" of image (in png/jpeg sense) gives way of packing image in sequence of bits. so, desire makes little sense. @ most, store bits in memory (what for?), same "saving it" (to memory instead of disk).
Comments
Post a Comment