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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -