@Override
    public Bitmap get(int width, int height, Bitmap.Config config) {
        int size = Util.getBitmapByteSize(width, height, config);
        Key targetKey = keyPool.get(size, config);
        Key bestKey = findBestKey(targetKey, size, config);

        Bitmap result = groupedMap.get(bestKey);
        if (result != null) {
            // Decrement must be called before reconfigure.
            decrementBitmapOfSize(Util.getBitmapByteSize(result), result.getConfig());
            result.reconfigure(width, height,
                    result.getConfig() != null ? result.getConfig() : Bitmap.Config.ARGB_8888);
        }
        return result;
    }
Keys {@link Bitmap Bitmaps} using both {@link Bitmap#getAllocationByteCount()} and
the {@link Bitmap.Config} returned from {@link Bitmap#getConfig()}.

<p>
    Using both the config and the byte size allows us to safely re-use a greater variety of
    {@link Bitmap Bitmaps}, which increases the hit rate of the pool and therefore the performance
    of applications. This class works around #301 by only allowing re-use of {@link Bitmap Bitmaps}
    with a matching number of bytes per pixel.
</p>
core/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/SizeConfigStrategy.java