You didn't post any of your code, so i have no idea what is wrong with your code. but you can convert a image to PNG or JPEG like this:
try {
FileOutputStream out = new FileOutputStream(filename);
bmp.compress(Bitmap.CompressFormat.PNG, 100, out); //100-best quality
out.close();
} catch (Exception e) {
e.printStackTrace();
}