I'm scaling down some bitmaps and getting low quality results.The result image looks different than original image.. I have used following code to scale down image,
Options options = new BitmapFactory.Options();
options.inScaled = false;
Bitmap ib=BitmapFactory.decodeResource(getResources(), R.drawable.card,options);
Bitmap mm=Bitmap.createScaledBitmap(ib,ib.getWidth()/5,ib.getHeight()/5, true);
AND
BitmapFactory.Options m_bmpFactoryOptions = new BitmapFactory.Options();
m_bmpFactoryOptions.inJustDecodeBounds = true;
Bitmap m_bitmap = BitmapFactory.decodeFile(p_file, m_bmpFactoryOptions);
int m_heightRatio =
(int) Math.ceil(m_bmpFactoryOptions.outHeight / (float) p_height);
int m_widthRatio =
(int) Math.ceil(m_bmpFactoryOptions.outWidth / (float) p_width);
if (m_heightRatio > 1 || m_widthRatio > 1)
{
if (m_heightRatio > m_widthRatio)
{
m_bmpFactoryOptions.inSampleSize = m_heightRatio;
}
else
{
m_bmpFactoryOptions.inSampleSize = m_widthRatio;
}
}
m_bmpFactoryOptions.inJustDecodeBounds = false;
m_bitmap = BitmapFactory.decodeFile(p_file, m_bmpFactoryOptions);
*Please help If there are any filters like lanczos,catrom to improve image quality after scale down *