Hot questions for Using Glide in image quality

Top 10 Java Open Source / Glide / image quality


hi i'm trying to save picture downloaded in device storage i have this methods for save pictures in storage but after saved i find that the picture quality is bad please help me i want to save the picture with the same orignal quality

     .into(new SimpleTarget<Bitmap>(100,100) {
     public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {

 private String saveImage(Bitmap image) {
    String savedImagePath = null;

    String imageFileName = "JPEG_" + "FILE_NAME" + ".jpg";
    File storageDir = new File(
                    + "/YOUR_FOLDER_NAME");
    boolean success = true;
    if (!storageDir.exists()) {
        success = storageDir.mkdirs();
    if (success) {
        File imageFile = new File(storageDir, imageFileName);
        savedImagePath = imageFile.getAbsolutePath();
        try {
            OutputStream fOut = new FileOutputStream(imageFile);
            image.compress(Bitmap.CompressFormat.JPEG, 100, fOut);
        } catch (Exception e) {

        // Add the image to the system gallery
        Toast.makeText(mContext, "IMAGE SAVED"), Toast.LENGTH_LONG).show();
    return savedImagePath;

private void galleryAddPic(String imagePath) {
    Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
    File f = new File(imagePath);
    Uri contentUri = Uri.fromFile(f);


This line:

.into(new SimpleTarget<Bitmap>(100,100)

Literally means that you want the image with a width of 100px and height of 100px, which is really really small, and i'm 99.99% sure this is what you mean with "bad quality".

If you want the 100% original image, you should use this:

.into(new SimpleTarget<Bitmap>(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)

"Target" is a class within Glide, and it has the "SIZE_ORIGINAL" constant.

That'll give you the full image, in original quality, which you can then save.


I build simple gallery. I load my photos using Glide. It looks like on images loaded by glide is some kind of streak (pixels seems to be visible). I tried to load photo with changed Format RGB_565/ARGB_8888 and I used .dontTransform() but still it looks worse than original photo.

Code I use to load :

ImageView photoDetails;
photoDetails = (ImageView)findViewById(;
        .load(pictureFile) //path to picture


To load the original image using Glide I use the code below:

                    .into(new SimpleTarget<Bitmap>(Target.SIZE_ORIGINAL,Target.SIZE_ORIGINAL) {
                        public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {

Remember that the picture in browser may look different on the device due to the screen resolution of your device. Using this method you will be able to check the pixels using the Bitmap object. Also, keep in mind that your ImageView must have width and height with WRAP_CONTENT value.