1

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);
    }    
Naveen
  • 7,944
  • 12
  • 78
  • 165

1 Answers1

1

No easy task; here's an outline of the brute-force approach:

Tile the image into manageable pieces using an available approach suited to the source, for example

  • Java getSubImage(), seen here.
  • Ossim, designed for geodetic data, but usable for imagery.

Resample the tiles as warranted by the intended use, for example

Reassemble the tiles; the approach depends on the destination.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045