title: re-size my image without blur
body: <p>I am making an app to capture image by using intent and re-sizing image according to me but it is blurred after being captured so I need to take suggestions and help.
  Actually I am re-sizing picture by scale "create Scaled Bitmap" and want to covert image in small size but after re-sizing in small size being blurred.</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == 1 &amp;&amp; resultCode == RESULT_OK) {
          try {
              if (requestCode == 1) {
                  if (data != null &amp;&amp; data.getExtras() != null &amp;&amp; data.getExtras().get("data") != null) {
                      bitmap = (Bitmap) data.getExtras().get("data");
  
                      int width = bitmap.getWidth();
                      int height = bitmap.getHeight();
                      int newWidth = 100;
                      int newHeight = 50;
                      float scaleWidth = ((float) newWidth) / width;
                      float scaleHeight = ((float) newHeight) / height;
  
                      Matrix matrix = new Matrix();
                      // resize the bit map
                      matrix.postScale(scaleWidth, scaleHeight);
                      // rotate the Bitmap
  
                      Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
  
                      int h = resizedBitmap.getHeight();
  
                      int b = resizedBitmap.getWidth();
                      Log.e("height &amp; width ", h + "" + b);
  
                      Bitmap resized = Bitmap.createScaledBitmap(bitmap, 25, 25, true);
  
                      int h1 = bitmap.getHeight();
                      int b1 = bitmap.getWidth();
                      Log.e("height 1  &amp; width  1", h1 + "" + b1);
  
                      mbPhotoImageViewId.setImageBitmap(resized);
                      int size = resized.getWidth() * resized.getHeight();
                      ByteArrayOutputStream stream = new ByteArrayOutputStream(size);
                      resized.compress(Bitmap.CompressFormat.PNG, 100, stream);
  
                      byte[] image = stream.toByteArray();
                      System.out.println("byte array:" + image.length + "   " + image);
  
                      img_str = Base64.encodeToString(image, Base64.DEFAULT);
                      System.out.println("string: " + img_str.length() + "   " + img_str);
  
                      Log.d("BITMAP form of image", image.toString());
  
                  }
              }
          } catch (Exception e) {
              e.toString();
              Toast.makeText(getApplicationContext(), " Error Code : C_M09004", Toast.LENGTH_LONG).show();
          }
      }
  }
  </code></pre>