code: public static void storeImage(Bitmap image, File pictureFile) {
          if (pictureFile == null) {
              QuickUtils.log.d("Error creating media file, check storage permissions: ");
              return;
          }
          try {
              FileOutputStream fos = new FileOutputStream(pictureFile);
              image.compress(Bitmap.CompressFormat.PNG, 90, fos);
              fos.close();
          } catch (FileNotFoundException e) {
              QuickUtils.log.d("File not found: " + e.getMessage());
          } catch (IOException e) {
              QuickUtils.log.d("Error accessing file: " + e.getMessage());
          }
      }
docs: Stores an image on the storage
  
  @param image       the image to store.
  @param pictureFile the file in which it must be stored