I want to scale a large 1920x1080 buffered image into smaller 200x200 size using progressive bicubic approach. I start with the 1024x768 and scale down to nearly 80% of original and then want to store this temp image somewhere in some format so that in next iteration i perform again the scaling to 80% on this image and continuing the procedure till i obtain 200x200 image which i finally display on my JFrame.
WHAT IS THE METHOD OR WAY TO STORE THIS TEMP IMAGE?OR CAN ANYONE SUGGEST A SIMPLE APPROACH TO IMPLEMENT THIS PROGRESSIVE BICUBIC SCALING.
The expected code looks similar to this(though it needs various modifications ,i need just the way to store temp image)
int sizew=1920,sizeh=1080;
int deltaw = (int)(0.20 *1920);
int deltah= (int)(0.20*1920);
while(sizew>200&&sizeh>200)
{
sizew=sizew-deltaw;
sizeh=sizeh-deltah;
if(sizew<200||sizeh<200)
{
sizew=200;
sizeh=200;
temp=new BufferedImage(sizew,sizeh,BufferedImage.TYPE_INT_RGB);
//but using this how would i give reference to my original 1920x1080 image or temp image???
break;
}
else
temp=new BufferedImage(sizew,sizeh,BufferedImage.TYPE_INT_RGB);
}