Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how use different Glide decodeformat for one app #1830

Closed
larry19840909 opened this issue Apr 1, 2017 · 2 comments
Closed

how use different Glide decodeformat for one app #1830

larry19840909 opened this issue Apr 1, 2017 · 2 comments
Labels

Comments

@larry19840909
Copy link

Our App is a photos app, there are two important Activities.
Activity 1 is album cover list
Activity 2 is showing the every photo of album.

For displaying high quality images in Acitivity 2, we set the decode format is ARGB8888, but it will be cause more memory usage. so we want to config the decode format of glide is ARGB565

But we don't know how to config.

Glide Version 3.7.0

@TWiStErRob
Copy link
Collaborator

TWiStErRob commented Apr 1, 2017

Set the default format to whatever you seem fit (or don't and be happy with the default 565): https://github.com/bumptech/glide/wiki/Configuration#bitmap-format

...and change the special places to the one that you need there:

Glide.with(this).load(url).asBitmap().format(DecodeFormat.PREFER_ARGB_8888).into(imageView);

(.asBitmap() turns off .crossFade(), if you need that (#1096), you can start using the 3.8.0 snapshot)

Note: 565 doesn't have alpha channel: 5 bits of Red, 6 bits of Green, 5 bits of Blue, so it's only 16 bits, hence half the space as an 8888 (32 bit) image, but lower quality, because not all colors can be expressed.

@larry19840909
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants