• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image scaling/encoding

 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,
Well, I need to change the scale/encoding of an image, so I wanted to ask you guys what is the best way to do that..
I have checked the j2se api for more then 2 hours, and I will not spend a minute extra.. The idea that I have from the api so far is to use
different image readers writers,(that inherit from javax.imageio.ImageReader )which have a read function that returns a
java.awt.image.BufferedImage object and the
javax.imageio.ImageReadParam which has the parameters of an image like width / height and could be passed to the different read functions of these Imager resders as a parameter.
So if I have a byte that contains a gif image and I want to transfrom that image to a smaller png image, I will set the desired dimention of the javax.imageio.ImageReadParam that I will pass to the pngreader, so when I read from it I will get a BufferedImage with the desired diemnntion..
Well sorry about this messy message, but I hope you will get it if you used image IO before..
My questions are: I think it could be done this way, but is it the right way (THE BEST wa) ? what is the best way to change the sacle and the encoding of an image without using any 3.rd party API (unless it is free and I don't have to make my source available) and the one that will work with all the 1.4+ JREs.? I have seen Java Advanced Imaging at sun's site, there is no need for it right? and it is not part of the standard JRE, right? The software will reside in a server, and it would be cool if it is quite fast, since it will probably have many users.. and should not use an API that I can not bundle in my application..
THANK YOU VERY much .. any help will be apriciated.
PS: It does not need to be hiper cool, and I have max 6 hours to make it work and test it, so please do not refer to some complex APIs, or image processing stuff. Awaiting your reply!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic